Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
million
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
million
Commits
28499fbf
Commit
28499fbf
authored
Mar 01, 2023
by
沈良进
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录注册功能开发
parent
e7ce9d5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
27 deletions
+69
-27
avatar.png
src/assets/img/avatar.png
+0
-0
hor-big-one.vue
src/components/navs/hor-big-one.vue
+13
-4
login.vue
src/pages/login.vue
+38
-21
resetPassword.vue
src/pages/resetPassword.vue
+18
-2
No files found.
src/assets/img/avatar.png
0 → 100644
View file @
28499fbf
5.12 KB
src/components/navs/hor-big-one.vue
View file @
28499fbf
...
@@ -265,15 +265,18 @@ color: #EE4454;
...
@@ -265,15 +265,18 @@ color: #EE4454;
</q-menu>
</q-menu>
</q-btn>
</q-btn>
<q-btn
label=
"帮助中心"
flat
></q-btn>
<q-btn
label=
"帮助中心"
flat
></q-btn>
<q-btn
v-if=
"LoginUser.
accountI
d <= 0"
label=
"注册"
flat
></q-btn>
<q-btn
v-if=
"LoginUser.
i
d <= 0"
label=
"注册"
flat
></q-btn>
<
template
v-if=
"LoginUser.
accountI
d > 0"
>
<
template
v-if=
"LoginUser.
i
d > 0"
>
<q-btn-dropdown
<q-btn-dropdown
style=
"color: #444; font-weight: bold"
style=
"color: #444; font-weight: bold"
class=
"q-ml-lg"
class=
"q-ml-lg"
icon=
"iconfont iconicon-unlogin"
:label=
"LoginUser.name"
unelevated
unelevated
>
>
<template
v-slot:label
>
<img
class=
"avatar"
v-if=
"LoginUser.photo"
:src=
"LoginUser.photo"
/>
<img
class=
"avatar"
v-else
src=
"../../assets/img/avatar.png"
/>
<!--
<span>
{{
LoginUser
.
name
||
LoginUser
.
mailbox
}}
</span>
-->
</
template
>
<div
class=
"row no-wrap q-pa-md"
>
<div
class=
"row no-wrap q-pa-md"
>
<div
class=
"column"
>
<div
class=
"column"
>
<q-list>
<q-list>
...
@@ -510,6 +513,7 @@ export default {
...
@@ -510,6 +513,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
isHome
=
this
.
$router
.
history
.
current
.
path
===
'/'
||
this
.
$router
.
history
.
current
.
path
===
'/index'
this
.
isHome
=
this
.
$router
.
history
.
current
.
path
===
'/'
||
this
.
$router
.
history
.
current
.
path
===
'/index'
console
.
log
(
'JSON.parse(window.localStorage.getItem("b2bUser"))'
,
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"b2bUser"
)))
if
(
localStorage
.
b2bUser
)
{
if
(
localStorage
.
b2bUser
)
{
this
.
LoginUser
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"b2bUser"
));
this
.
LoginUser
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"b2bUser"
));
}
}
...
@@ -710,6 +714,11 @@ export default {
...
@@ -710,6 +714,11 @@ export default {
</
script
>
</
script
>
<
style
>
<
style
>
.avatar
{
width
:
38px
;
height
:
38px
;
border-radius
:
50%
;
}
.nav-items
{
.nav-items
{
position
:
relative
;
position
:
relative
;
}
}
...
...
src/pages/login.vue
View file @
28499fbf
...
@@ -101,9 +101,26 @@
...
@@ -101,9 +101,26 @@
<q-input
outlined
v-model=
"loginMsg.Mailbox"
/>
<q-input
outlined
v-model=
"loginMsg.Mailbox"
/>
<div
class=
"primary q-mt-sm"
v-show=
"tips"
>
邮箱格式有误,请核实
</div>
<div
class=
"primary q-mt-sm"
v-show=
"tips"
>
邮箱格式有误,请核实
</div>
</div>
</div>
<div
class=
"form-group"
v-if=
"loginType === 'PassWord'"
>
<div
v-if=
"loginType === 'MailCode'|| loginType === 'bindEmail'"
>
<q-btn
v-if=
"!isSend"
class=
"q-mb-lg"
unelevated
color=
"grey-3"
style=
"width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label=
"发送验证码"
@
click=
"sendVerify"
/>
<div
v-else
class=
"mt q-mb-sm"
>
<q-input
outlined
v-model=
"loginMsg.MailCode"
type=
"text"
/>
<div
class=
"q-mt-sm"
:class=
"cutDown ? 'text-grey-6' : ''"
>
{{
cutDown
?
cutDown
+
"秒后可重新发送"
:
"重新發送驗證碼"
}}
</div>
</div>
</div>
<div
v-if=
"!isLogin || loginType ==='PassWord'"
class=
"form-group"
>
<div
class=
"login_labelName flex justify-between items-center"
>
<div
class=
"login_labelName flex justify-between items-center"
>
密碼
<span
class=
"text-grey-6 cursor-pointer"
@
click=
"resetPassword"
>
忘記密碼
</span>
密碼
<span
class=
"text-grey-6 cursor-pointer"
v-if=
"loginType === 'PassWord'"
@
click=
"resetPassword"
>
忘記密碼
</span>
</div>
</div>
<q-input
<q-input
v-if=
"flag == 1"
v-if=
"flag == 1"
...
@@ -130,23 +147,6 @@
...
@@ -130,23 +147,6 @@
@
click=
"flag = 1"
@
click=
"flag = 1"
></i>
></i>
</div>
</div>
<div
v-else-if=
"loginType === 'MailCode'|| loginType === 'bindEmail'"
>
<q-btn
v-if=
"!isSend"
class=
"q-mb-lg"
unelevated
color=
"grey-3"
style=
"width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label=
"发送验证码"
@
click=
"sendVerify"
/>
<div
v-else
class=
"mt q-mb-sm"
>
<q-input
outlined
v-model=
"loginMsg.MailCode"
type=
"text"
/>
<div
class=
"q-mt-sm"
:class=
"cutDown ? 'text-grey-6' : ''"
>
{{
cutDown
?
cutDown
+
"秒后可重新发送"
:
"重新發送驗證碼"
}}
</div>
</div>
</div>
<div
<div
class=
"text-right f16 text-grey-6 cursor-pointer"
class=
"text-right f16 text-grey-6 cursor-pointer"
v-if=
"isLogin"
v-if=
"isLogin"
...
@@ -309,10 +309,27 @@ this.CommonJump("/index", {});
...
@@ -309,10 +309,27 @@ this.CommonJump("/index", {});
}
}
},
},
sendVerify
()
{
sendVerify
()
{
if
(
this
.
inSending
)
return
this
.
inSending
=
true
if
(
this
.
verifyEmail
())
{
if
(
this
.
verifyEmail
())
{
this
.
isSend
=
true
;
let
SendType
=
this
.
userId
?
3
:
(
this
.
isLogin
?
1
:
0
);
this
.
apipost
(
'directCustomer_post_SendMail'
,
{
Mailbox
:
this
.
loginMsg
.
Mailbox
,
SendType
:
SendType
,
Id
:
this
.
userId
},
(
res
)
=>
{
this
.
inSending
=
false
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
isSend
=
true
;
this
.
cutDown
=
60
;
this
.
cutDown
=
60
;
this
.
startCutDown
();
this
.
startCutDown
();
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
)
}
else
{
this
.
inSending
=
false
}
}
},
},
startCutDown
()
{
startCutDown
()
{
...
@@ -358,7 +375,6 @@ this.CommonJump("/index", {});
...
@@ -358,7 +375,6 @@ this.CommonJump("/index", {});
// this.loginType = "wechat";
// this.loginType = "wechat";
// this.setWechatCode()
// this.setWechatCode()
const
{
AppID
,
State
,
OpenRedirectUri
}
=
this
.
openInfo
;
const
{
AppID
,
State
,
OpenRedirectUri
}
=
this
.
openInfo
;
console
.
log
(
"encodeURI('http://localhost:9090/login')"
,
OpenRedirectUri
)
let
redirect_uri
=
OpenRedirectUri
let
redirect_uri
=
OpenRedirectUri
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
AppID
}
&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_login&state=
${
State
}
&wechat_redirect=
${
redirect_uri
}
`
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
AppID
}
&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_login&state=
${
State
}
&wechat_redirect=
${
redirect_uri
}
`
// this.windowObjectReference = window.open(url, 'wechat', 'left: 20,top: 20,width:200,height:200,')
// this.windowObjectReference = window.open(url, 'wechat', 'left: 20,top: 20,width:200,height:200,')
...
@@ -426,6 +442,7 @@ this.CommonJump("/index", {});
...
@@ -426,6 +442,7 @@ this.CommonJump("/index", {});
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
var
jsonData
=
JSON
.
stringify
(
res
.
data
.
data
);
var
jsonData
=
JSON
.
stringify
(
res
.
data
.
data
);
window
.
localStorage
.
setItem
(
"b2bUser"
,
jsonData
);
window
.
localStorage
.
setItem
(
"b2bUser"
,
jsonData
);
console
.
log
(
'userInfo'
,
jsonData
,
res
.
data
.
data
)
this
.
CommonJump
(
"/index"
,
{});
this
.
CommonJump
(
"/index"
,
{});
}
else
{
}
else
{
this
.
$q
.
notify
({
this
.
$q
.
notify
({
...
...
src/pages/resetPassword.vue
View file @
28499fbf
...
@@ -183,10 +183,26 @@ export default {
...
@@ -183,10 +183,26 @@ export default {
},
},
methods
:
{
methods
:
{
sendVerify
()
{
sendVerify
()
{
if
(
this
.
inSending
)
return
this
.
inSending
=
true
if
(
this
.
verifyEmail
())
{
if
(
this
.
verifyEmail
())
{
this
.
isSend
=
true
;
this
.
apipost
(
'directCustomer_post_SendMail'
,
{
Mailbox
:
this
.
loginMsg
.
Mailbox
,
SendType
:
2
},
(
res
)
=>
{
this
.
inSending
=
false
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
isSend
=
true
;
this
.
cutDown
=
60
;
this
.
cutDown
=
60
;
this
.
startCutDown
();
this
.
startCutDown
();
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
)
}
else
{
this
.
inSending
=
false
}
}
},
},
startCutDown
()
{
startCutDown
()
{
...
@@ -241,7 +257,7 @@ export default {
...
@@ -241,7 +257,7 @@ export default {
}
}
this
.
mylabel
=
"提交中..."
;
this
.
mylabel
=
"提交中..."
;
this
.
apipost
(
this
.
apipost
(
'
MailboxPwdLogin
_post'
,
'
ResettingPwd
_post'
,
this
.
loginMsg
,
this
.
loginMsg
,
(
res
)
=>
{
(
res
)
=>
{
this
.
mylabel
=
"重置密码"
;
this
.
mylabel
=
"重置密码"
;
...
...
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