Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sup-server
Project
Project
Details
Activity
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
Administrator
sup-server
Commits
fa7018b1
Commit
fa7018b1
authored
Nov 21, 2022
by
tyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证码登录修复
parent
f9c03751
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
login.vue
dsk-srm-server/src/login.vue
+5
-11
user-module.js
dsk-srm-server/src/store/modules/user-module.js
+20
-3
No files found.
dsk-srm-server/src/login.vue
View file @
fa7018b1
...
...
@@ -174,7 +174,7 @@
<br>
本条例解释权归交易平台所有。
</div>
<div
slot=
"footer"
>
<el-button
class=
"searchBtn"
type=
"primary"
style=
"width: 90px;"
@
click=
"goRegister"
>
同意
</el-button>
<el-button
class=
"searchBtn"
type=
"primary"
style=
"width: 90px;"
@
click=
"goRegister"
>
同意
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
</div>
</el-dialog>
...
...
@@ -419,7 +419,7 @@ export default {
return
false
;
}
this
.
$store
.
dispatch
(
"user/userLogin"
,
this
.
mimaparam
).
then
(
(
res
)
=>
{
this
.
$store
.
dispatch
(
"user/userLogin"
,
this
.
mimaparam
).
then
(
res
=>
{
this
.
toList
();
});
...
...
@@ -430,14 +430,8 @@ export default {
this
.
$message
.
error
(
'账号、验证码不能为空!'
);
return
false
;
}
smsLogin
(
this
.
yzmparam
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
let
token
=
res
.
token
;
this
.
$store
.
commit
(
"user/SET_TOKEN"
,
token
);
this
.
toList
();
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
this
.
$store
.
dispatch
(
"user/smsLogin"
,
this
.
yzmparam
).
then
(
res
=>
{
this
.
toList
();
});
},
//验证短信验证码、图形验证码
...
...
@@ -584,7 +578,7 @@ export default {
return
isJPG
&&
isLt2M
;
},
goRegister
()
{
this
.
$router
.
push
(
'/register'
)
this
.
$router
.
push
(
'/register'
)
;
}
}
}
...
...
dsk-srm-server/src/store/modules/user-module.js
View file @
fa7018b1
import
{
loginApi
,
getUserInfoApi
,
loginOutApi
}
from
"@/api/login"
;
import
{
loginApi
,
getUserInfoApi
,
loginOutApi
,
smsLogin
}
from
"@/api/login"
;
import
{
getToken
,
setToken
,
removeToken
}
from
"@/utils/auth"
;
const
state
=
{
token
:
getToken
(),
...
...
@@ -21,7 +21,7 @@ const actions = {
* @param {Object} payload 参数
* @param {Function} commit 提交同步处理数据
*/
userLogin
({
commit
},
payload
)
{
userLogin
({
commit
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 登录api调用
...
...
@@ -38,12 +38,29 @@ const actions = {
});
},
smsLoginHandler
({
commit
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 登录api调用
smsLogin
(
payload
).
then
(
res
=>
{
// 获取token
commit
(
"SET_TOKEN"
,
res
.
token
);
setToken
(
res
.
token
);
resolve
(
res
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
reject
(
err
);
});
});
},
/**
* 根据token 获取用户信息
* @param {Object} payload 参数
* @param {Function} commit 提交同步处理数据
*/
getUserInfo
({
commit
},
payload
)
{
getUserInfo
({
commit
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 用户信息api调用
...
...
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