Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
a5be666f
Commit
a5be666f
authored
Jun 07, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信 登录
parent
217a1772
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
index.ts
src/router/index.ts
+1
-1
BindToWechat.vue
src/views/Auth/BindToWechat.vue
+11
-17
Login.vue
src/views/Auth/Login.vue
+6
-0
No files found.
src/router/index.ts
View file @
a5be666f
...
@@ -10,7 +10,7 @@ const router = createRouter({
...
@@ -10,7 +10,7 @@ const router = createRouter({
})
})
const
whiteList
=
[
'/autoLogin'
,
'/login'
,
'/notfound'
,
'/regist'
,
'/'
,
'/forgot'
,
'/newpass'
,
'/notsupported'
]
const
whiteList
=
[
'/autoLogin'
,
'/login'
,
'/notfound'
,
'/regist'
,
'/'
,
'/forgot'
,
'/newpass'
,
'/notsupported'
,
'/BindToWechat'
]
const
managerMenu
=
[
'/market'
,
'/editor_admin'
]
const
managerMenu
=
[
'/market'
,
'/editor_admin'
]
let
loadingInstance
:
any
=
null
let
loadingInstance
:
any
=
null
...
...
src/views/Auth/BindToWechat.vue
View file @
a5be666f
<
template
>
<
template
>
<div
class=
"window-height
regist
-box column flex-center items-center"
>
<div
class=
"window-height
bind
-box column flex-center items-center"
>
<div
class=
"column flex-center items-center rounded light-shadow q-pa-xl bg-white"
style=
"margin: 60px 0;"
>
<div
class=
"column flex-center items-center rounded light-shadow q-pa-xl bg-white"
style=
"margin: 60px 0;"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<div
style=
"font-size: 1.88vw; line-height: 1;"
class=
"text-dark text-weight-bolder row items-end flex-center"
>
<div
style=
"font-size: 1.88vw; line-height: 1;
padding-top: 40px;
"
class=
"text-dark text-weight-bolder row items-end flex-center"
>
<span>
立即绑定
</span>
<span>
立即绑定
</span>
</div>
</div>
<div
class=
"text-small"
style=
"color:#404B5B;margin-top:0.99vw"
>
绑定账号,登录更轻松
</div>
<div
class=
"text-small"
style=
"color:#404B5B;margin-top:0.99vw"
>
绑定账号,登录更轻松
</div>
</div>
</div>
<div
style=
"width:400px;padding:0 50px;"
>
<div
style=
"width:400px;padding:0 50px;"
>
<el-form
ref=
"registFormRef"
:model=
"model"
:rules=
"rules"
label-width=
"0px"
size=
"large"
class=
"full-width q-mt-lg"
:disabled=
"loading"
>
<el-form
ref=
"bindFormRef"
:model=
"model"
:rules=
"rules"
label-width=
"0px"
size=
"large"
class=
"full-width q-mt-lg"
:disabled=
"loading"
>
<!--
<el-form-item
label=
""
prop=
"nickname"
>
<el-input
v-model=
"model.nickname"
placeholder=
"昵称"
class=
"q-mt-lg"
/>
</el-form-item>
-->
<!--
<el-form-item
label=
""
prop=
"account"
>
<el-input
v-model=
"model.account"
placeholder=
"账号"
/>
</el-form-item>
-->
<el-form-item
label=
""
prop=
"mail"
>
<el-form-item
label=
""
prop=
"mail"
>
<el-input
v-model=
"model.mail"
placeholder=
"邮箱"
>
<el-input
v-model=
"model.mail"
placeholder=
"邮箱"
>
<template
#
suffix
>
<template
#
suffix
>
...
@@ -39,12 +33,12 @@
...
@@ -39,12 +33,12 @@
<!-- <vue-hcaptcha ref="invisibleHcaptcha" sitekey="46e00e53-ddb2-4e7b-9c51-621534c2f1f5" @verify="verifyHandler"></vue-hcaptcha> -->
<!-- <vue-hcaptcha ref="invisibleHcaptcha" sitekey="46e00e53-ddb2-4e7b-9c51-621534c2f1f5" @verify="verifyHandler"></vue-hcaptcha> -->
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
class=
"full-width q-mb-lg"
@
click=
"submitForm(
regist
FormRef)"
:loading=
"loading"
>
立即绑定
</el-button>
<el-button
type=
"primary"
class=
"full-width q-mb-lg"
@
click=
"submitForm(
bind
FormRef)"
:loading=
"loading"
>
立即绑定
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
class=
"text-info text-small row flex-center"
>
<div
class=
"text-info text-small row flex-center"
>
<span>
</span>
<span>
密码登录?
</span>
<el-button
link
type=
"primary"
class=
"q-mb-lg"
>
</el-button>
<el-button
link
type=
"primary"
class=
"q-mb-lg"
@
click=
"redicetToLogin"
>
立即登录
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -78,7 +72,7 @@ const model = ref<{password:string,confirmPwd:string,mail:string,code:string}>({
...
@@ -78,7 +72,7 @@ const model = ref<{password:string,confirmPwd:string,mail:string,code:string}>({
phone
:
''
phone
:
''
})
})
const
validateToken
=
ref
(
''
)
const
validateToken
=
ref
(
''
)
const
regist
FormRef
=
ref
<
FormInstance
>
()
const
bind
FormRef
=
ref
<
FormInstance
>
()
const
invisibleHcaptcha
=
ref
<
VueHcaptcha
|
null
>
(
null
)
const
invisibleHcaptcha
=
ref
<
VueHcaptcha
|
null
>
(
null
)
const
loading
=
ref
(
false
)
const
loading
=
ref
(
false
)
const
sending
=
ref
(
false
)
const
sending
=
ref
(
false
)
...
@@ -142,16 +136,16 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -142,16 +136,16 @@ const submitForm = async (formEl: FormInstance | undefined) => {
loading
.
value
=
false
loading
.
value
=
false
return
return
}
}
await
regist
Handler
()
await
bind
Handler
()
}
}
loading
.
value
=
false
loading
.
value
=
false
})
})
}
}
const
regist
Handler
=
async
()
=>
{
const
bind
Handler
=
async
()
=>
{
const
response
=
await
UserServices
.
RegistUserAsync
(
model
.
value
.
mail
,
model
.
value
.
password
,
model
.
value
.
code
,
validateToken
.
value
)
const
response
=
await
UserServices
.
RegistUserAsync
(
model
.
value
.
mail
,
model
.
value
.
password
,
model
.
value
.
code
,
validateToken
.
value
)
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
ElMessage
.
success
({
message
:
'
注册
成功,正在跳转'
})
ElMessage
.
success
({
message
:
'
绑定
成功,正在跳转'
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
redicetToLogin
()
redicetToLogin
()
},
1000
);
},
1000
);
...
@@ -185,7 +179,7 @@ const sendVerifyCode = async () => {
...
@@ -185,7 +179,7 @@ const sendVerifyCode = async () => {
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.
regist
-box
{
.
bind
-box
{
background-image
:
url('../../assets/img/regist.png')
,
linear-gradient
(
0deg
,
#E3ECFF
,
#FFFFFF
);
background-image
:
url('../../assets/img/regist.png')
,
linear-gradient
(
0deg
,
#E3ECFF
,
#FFFFFF
);
background-size
:
100%
auto
;
background-size
:
100%
auto
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
...
...
src/views/Auth/Login.vue
View file @
a5be666f
...
@@ -61,6 +61,9 @@
...
@@ -61,6 +61,9 @@
<span>
还没有账号?
</span>
<span>
还没有账号?
</span>
<el-button
link
type=
"primary"
class=
"q-mb-lg"
@
click=
"redicetToRegist"
>
立即注册
</el-button>
<el-button
link
type=
"primary"
class=
"q-mb-lg"
@
click=
"redicetToRegist"
>
立即注册
</el-button>
</div>
</div>
<div
class=
"text-info text-small row flex-center"
>
<img
class=
"cursor-pointer"
src=
"../../assets/img/wechatLogin.png"
style=
"width:1.67vw;"
alt=
""
@
click=
"redicetToWechat"
>
</div>
</el-form>
</el-form>
</
template
>
</
template
>
<
template
v-if=
"multipleUsers && multipleUsers.length>0"
>
<
template
v-if=
"multipleUsers && multipleUsers.length>0"
>
...
@@ -185,6 +188,9 @@ const userLoginHandler = async ()=>{
...
@@ -185,6 +188,9 @@ const userLoginHandler = async ()=>{
}
}
}
}
const
redicetToWechat
=
()
=>
{
location
.
href
=
'/BindToWechat'
}
const
forwardWorkspaceHandler
=
()
=>
{
const
forwardWorkspaceHandler
=
()
=>
{
location
.
href
=
'/space'
;
location
.
href
=
'/space'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment