|
@@ -12,7 +12,7 @@ const user = {
|
|
avatar: '',
|
|
avatar: '',
|
|
roles: { permissionList: [] },
|
|
roles: { permissionList: [] },
|
|
info: {},
|
|
info: {},
|
|
- nowRouteName: '' // 当前路由名称
|
|
|
|
|
|
+ nowRouteName: '' // 当前路由名称
|
|
},
|
|
},
|
|
|
|
|
|
mutations: {
|
|
mutations: {
|
|
@@ -37,9 +37,9 @@ const user = {
|
|
SET_MUSTCHANGEPWD: (state, status) => {
|
|
SET_MUSTCHANGEPWD: (state, status) => {
|
|
state.mustChangePwd = status
|
|
state.mustChangePwd = status
|
|
},
|
|
},
|
|
- SET_NOWROUTENAME: (state, name) => {
|
|
|
|
|
|
+ SET_NOWROUTENAME: (state, name) => {
|
|
state.nowRouteName = name
|
|
state.nowRouteName = name
|
|
- }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
actions: {
|
|
actions: {
|
|
@@ -55,6 +55,7 @@ const user = {
|
|
const users = res.auth_user
|
|
const users = res.auth_user
|
|
Vue.ls.set('hasError', 0)
|
|
Vue.ls.set('hasError', 0)
|
|
commit('SET_TOKEN', res.access_token)
|
|
commit('SET_TOKEN', res.access_token)
|
|
|
|
+ commit('SET_INFO', users)
|
|
commit('SET_NAME', { name: users.userNameCN, welcome: welcome() })
|
|
commit('SET_NAME', { name: users.userNameCN, welcome: welcome() })
|
|
commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
|
|
commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
|
|
Vue.ls.set('rolesAccess', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
|
|
Vue.ls.set('rolesAccess', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
|
|
@@ -96,6 +97,7 @@ const user = {
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
resolve(error)
|
|
resolve(error)
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
|
+ commit('SET_INFO', {})
|
|
commit('SET_NAME', { name: '', welcome: '' })
|
|
commit('SET_NAME', { name: '', welcome: '' })
|
|
commit('SET_MUSTCHANGEPWD', '')
|
|
commit('SET_MUSTCHANGEPWD', '')
|
|
commit('SET_AVATAR', '')
|
|
commit('SET_AVATAR', '')
|