Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcxy-manage-shell
Project
Overview
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
姜雷
dcxy-manage-shell
Commits
91888066
Commit
91888066
authored
Apr 01, 2019
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加修改手机号方法
parent
a45e068f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
UserBox.vue
src/containers/layout/components/UserBox.vue
+2
-1
index.js
src/store/modules/user/index.js
+32
-0
No files found.
src/containers/layout/components/UserBox.vue
View file @
91888066
...
...
@@ -485,7 +485,8 @@ export default {
this
.
updateUserCellphone
(
entity
)
.
then
(
res
=>
{
this
.
resetCellphoneForm
();
console
.
log
(
res
);
this
.
$message
.
success
(
res
.
msg
||
'修改成功'
);
this
.
cancelCellphoneUpdate
();
})
.
catch
(
err
=>
{
console
.
log
(
err
);
...
...
src/store/modules/user/index.js
View file @
91888066
import
{
login
,
logout
,
changePwd
}
from
'@/api/user/login'
;
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
;
import
{
SET_TOKEN
,
UPDATE_USERINFO
}
from
'./mutation-types'
;
import
{
updateUserinfo
,
updateUserCellphone
}
from
'@/api/user/update'
;
import
md5
from
'blueimp-md5'
;
const
state
=
{
...
...
@@ -85,6 +86,37 @@ const actions = {
dispatch
(
'getAsyncRoute'
,
userRoles
);
});
},
// 修改资料
updateUserinfo
({
commit
,
dispatch
},
{
name
,
newPwd
,
oldPwd
})
{
return
updateUserinfo
({
data
:
newPwd
?
{
name
,
newPwd
:
md5
(
newPwd
),
oldPwd
:
md5
(
oldPwd
),
}
:
{
name
,
},
}).
then
(
res
=>
{
const
{
data
:
{
userRoles
,
userInfo
},
}
=
res
;
commit
(
UPDATE_USERINFO
,
userInfo
);
dispatch
(
'getAsyncRoute'
,
userRoles
);
return
res
;
});
},
// 修改电话
updateUserCellphone
({
commit
},
entity
)
{
return
updateUserCellphone
({
params
:
entity
,
}).
then
(
res
=>
{
console
.
log
(
res
);
commit
(
UPDATE_USERINFO
,
entity
);
return
res
;
});
},
};
const
mutations
=
{
...
...
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