update
This commit is contained in:
parent
722437b24f
commit
543a82120a
@ -3,7 +3,7 @@
|
|||||||
* @version:
|
* @version:
|
||||||
* @Date: 2021-04-20 11:06:21
|
* @Date: 2021-04-20 11:06:21
|
||||||
* @LastEditors: huzhushan@126.com
|
* @LastEditors: huzhushan@126.com
|
||||||
* @LastEditTime: 2021-09-18 15:40:50
|
* @LastEditTime: 2021-11-15 09:51:45
|
||||||
* @Author: huzhushan@126.com
|
* @Author: huzhushan@126.com
|
||||||
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
|
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
|
||||||
* @Github: https://github.com/huzhushan/vue3-element-admin
|
* @Github: https://github.com/huzhushan/vue3-element-admin
|
||||||
@ -51,6 +51,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
setToken({ commit, dispatch }, payload) {
|
||||||
|
dispatch('clearToken')
|
||||||
|
commit('setToken', payload)
|
||||||
|
},
|
||||||
clearToken({ commit }) {
|
clearToken({ commit }) {
|
||||||
// 清除token
|
// 清除token
|
||||||
commit('clearToken')
|
commit('clearToken')
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* @version:
|
* @version:
|
||||||
* @Date: 2021-04-20 11:06:21
|
* @Date: 2021-04-20 11:06:21
|
||||||
* @LastEditors: huzhushan@126.com
|
* @LastEditors: huzhushan@126.com
|
||||||
* @LastEditTime: 2021-11-12 11:28:20
|
* @LastEditTime: 2021-11-15 09:48:29
|
||||||
* @Author: huzhushan@126.com
|
* @Author: huzhushan@126.com
|
||||||
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
|
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
|
||||||
* @Github: https://github.com/huzhushan/vue3-element-admin
|
* @Github: https://github.com/huzhushan/vue3-element-admin
|
||||||
@ -112,10 +112,8 @@ export default defineComponent({
|
|||||||
} else {
|
} else {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
}
|
}
|
||||||
if (store.state.app.authorization) {
|
|
||||||
store.dispatch('app/clearToken')
|
store.dispatch('app/setToken', data)
|
||||||
}
|
|
||||||
store.commit('app/setToken', data)
|
|
||||||
} else {
|
} else {
|
||||||
ctx.$message.error(message)
|
ctx.$message.error(message)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user