增加userId获取方法
This commit is contained in:
parent
b7b94de40e
commit
53bc0d22fd
stdiet-ui/src/store
@ -10,6 +10,7 @@ const getters = {
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
userId: state => state.user.userId,
|
||||
permission_routes: state => state.permission.routes
|
||||
}
|
||||
export default getters
|
||||
|
@ -25,6 +25,9 @@ const user = {
|
||||
},
|
||||
SET_PERMISSIONS: (state, permissions) => {
|
||||
state.permissions = permissions
|
||||
},
|
||||
SET_USERID: (state, userId) => {
|
||||
state.userId = userId
|
||||
}
|
||||
},
|
||||
|
||||
@ -60,13 +63,14 @@ const user = {
|
||||
}
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_AVATAR', avatar)
|
||||
commit('SET_USERID', user.userId)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 退出系统
|
||||
LogOut({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user