Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
542c8486
authored
2024-02-20 18:25:43 +0800
by
杨炀
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add:
1.注册 2.登录
1 parent
a7717cc5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
22 deletions
src/layoutPc/components/AppHeader.vue
src/main.js
src/permissionPc.js
src/routerPc/cn.js
src/viewsPc/login.vue
src/viewsPc/register/team/step1.vue
src/viewsPc/register/team/step2.vue
src/viewsPc/register/team/team.vue
src/layoutPc/components/AppHeader.vue
View file @
542c848
...
...
@@ -164,10 +164,10 @@ onMounted(() => {
if
(
useUserStore
().
user
)
{
isLogin
.
value
=
true
}
if
(
window
.
location
.
href
.
indexOf
(
'en'
)
>
-
1
)
{
cache
.
local
.
set
(
'language'
,
1
)
// location.reload()
}
//
if (window.location.href.indexOf('en') > -1) {
//
cache.local.set('language', 1)
//
// location.reload()
//
}
if
(
route
.
fullPath
.
indexOf
(
'news'
)
>
-
1
)
{
activeIndex
.
value
=
'/news'
}
else
if
(
route
.
fullPath
.
indexOf
(
'notice'
)
>
-
1
)
{
...
...
src/main.js
View file @
542c848
...
...
@@ -17,7 +17,7 @@ import 'virtual:svg-icons-register'
import
SvgIcon
from
'@/components/SvgIcon'
import
elementIcons
from
'@/components/SvgIcon/svgicon'
import
'./permissionPc'
// permission control
//
import './permissionPc' // permission control
import
*
as
socket
from
'./utils/sockets'
import
{
useDict
}
from
'@/utils/dict'
...
...
@@ -95,7 +95,6 @@ app.component('Editor', Editor)
app
.
component
(
'Draggable'
,
draggable
)
app
.
component
(
'WePay'
,
wePay
)
if
(
language
==
0
)
{
app
.
use
(
routerCn
)
app
.
use
(
ElementPlus
,
{
...
...
src/permissionPc.js
View file @
542c848
import
router
from
'./routerPc/
index
'
import
router
from
'./routerPc/
cn
'
import
{
ElMessage
}
from
'element-plus'
import
NProgress
from
'nprogress'
import
'nprogress/nprogress.css'
...
...
@@ -10,7 +10,7 @@ NProgress.configure({ showSpinner: false })
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
//
debugger
debugger
if
(
getToken
())
{
// 判断当前用户是否已拉取完user_info信息
if
(
!
useUserStore
().
user
)
{
...
...
src/routerPc/cn.js
View file @
542c848
...
...
@@ -6,6 +6,11 @@ import {
/* Layout */
import
Layout
from
'@/layoutPc'
import
Empty
from
'@/layoutPc/empty'
import
NProgress
from
"nprogress"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
useUserStore
from
"@/store/modules/user"
;
import
{
isRelogin
}
from
"@/utils/request"
;
import
{
ElMessage
}
from
"element-plus"
;
// import useUserStore from '@/store/modules/user'
/**
...
...
@@ -517,4 +522,34 @@ const router = createRouter({
}
})
NProgress
.
configure
({
showSpinner
:
false
})
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
if
(
getToken
())
{
// 判断当前用户是否已拉取完user_info信息
if
(
!
useUserStore
().
user
)
{
isRelogin
.
show
=
true
useUserStore
().
getInfo
().
then
(()
=>
{
isRelogin
.
show
=
false
next
()
// hack方法 确保addRoutes已完成
}).
catch
(
err
=>
{
useUserStore
().
logOut
().
then
(()
=>
{
ElMessage
.
error
(
err
)
next
({
path
:
'/'
})
})
})
}
else
{
next
()
}
}
else
{
// 没有token
next
()
}
})
router
.
afterEach
((
to
)
=>
{
NProgress
.
done
()
})
export
default
router
...
...
src/viewsPc/login.vue
View file @
542c848
...
...
@@ -103,9 +103,14 @@
@
keyup
.
enter=
"handleLogin"
>
<
template
#
append
>
<span
class=
"text-primary"
@
click=
"sendsmsMsg"
>
发送验证码
</span>
<el-button
type=
"primary"
plain
style=
"width: 110px"
@
click=
"sendsmsMsg"
>
<count-down
v-if=
"counting"
v-slot=
"
{ totalSeconds }" :time="60000" @end="counting=false">
{{
totalSeconds
}}
秒
</count-down>
<span
v-else
>
发送验证码
</span>
</el-button>
</
template
>
</el-input>
<div
class=
"vcodeBox"
:style=
"isShow?'height:240px':'height:0'"
>
...
...
@@ -152,6 +157,8 @@
</template>
<
script
setup
>
import
Vcode
from
"vue3-puzzle-vcode"
import
CountDown
from
'@chenfengyuan/vue-countdown'
import
{
getCodeImg
}
from
'@/api/login'
import
*
as
match
from
'@/apiPc/match'
import
Cookies
from
'js-cookie'
...
...
@@ -411,4 +418,11 @@ function sendsmsMsg() {
}
&
:hover
{
color
:
#fff
;}
}
.el-input-group__append
{
flex
:
1
1
auto
;}
.el-input-group__append
button
.el-button
,
.el-input-group__append
button
.el-button
:hover
{
color
:
var
(
--el-color-primary
);
background
:
#efefff
;
border
:
var
(
--el-color-primary
)
solid
1px
;
border-radius
:
0
;
}
</
style
>
...
...
src/viewsPc/register/team/step1.vue
View file @
542c848
...
...
@@ -32,8 +32,7 @@
</template>
<
script
setup
>
import
{
reactive
}
from
"@vue/runtime-core"
;
import
{
toRefs
}
from
"@vueuse/shared/index"
;
import
{
reactive
,
toRefs
}
from
'vue'
import
Vcode
from
"vue3-puzzle-vcode"
import
{
ElMessage
}
from
'element-plus'
import
CountDown
from
'@chenfengyuan/vue-countdown'
...
...
src/viewsPc/register/team/step2.vue
View file @
542c848
...
...
@@ -2,7 +2,7 @@
<el-card>
<div
class=
"border-info text-center"
>
<label>
登录账号
</label>
321
<label>
登录账号
</label>
{{
accont
}}
</div>
<div
class=
"leftboderTT"
>
登录密码
<span>
(登录时需要验证,保护账户信息)
</span></div>
...
...
@@ -80,11 +80,13 @@ import {setToken} from "@/utils/auth";
const
{
proxy
}
=
getCurrentInstance
()
const
emit
=
defineEmits
([
'submit'
,
'prev'
])
const
props
=
defineProps
({
accont
:{
type
:
String
,
required
:
true
}
})
const
data
=
reactive
({
form
:
{
username
:
'eryewawa@163.com'
},
loading
:
false
,
countryList
:
[],
...
...
src/viewsPc/register/team/team.vue
View file @
542c848
...
...
@@ -10,14 +10,10 @@
<el-step
title=
"注册完成"
/>
</el-steps>
</el-card>
<div
class=
"mt20"
></div>
<Step1
v-if=
"activeStep==0"
@
submit=
"toStep2"
@
userName=
"getUserName"
/>
<Step2
v-if=
"activeStep==1"
@
submit=
"toStep3"
@
prev=
"toStep1"
/>
<Step2
v-if=
"activeStep==1"
@
submit=
"toStep3"
@
prev=
"toStep1"
:accont=
"form.userName"
/>
<Step3
v-if=
"activeStep==2"
/>
</div>
</div>
</div>
...
...
@@ -34,7 +30,9 @@ const data = reactive({
isShow
:
false
,
isCodeTrue
:
false
,
counting
:
false
,
form
:{},
form
:{
userName
:
'1111'
},
activeStep
:
0
})
const
{
isShow
,
isCodeTrue
,
counting
,
form
,
activeStep
}
=
toRefs
(
data
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment