Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zsen hu committed Nov 15, 2021
1 parent 722437b commit 543a821
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @version:
* @Date: 2021-04-20 11:06:21
* @LastEditors: [email protected]
* @LastEditTime: 2021-09-18 15:40:50
* @LastEditTime: 2021-11-15 09:51:45
* @Author: [email protected]
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
* @Github: https://github.com/huzhushan/vue3-element-admin
Expand Down Expand Up @@ -51,6 +51,10 @@ export default {
},
},
actions: {
setToken({ commit, dispatch }, payload) {
dispatch('clearToken')
commit('setToken', payload)
},
clearToken({ commit }) {
// 清除token
commit('clearToken')
Expand Down
8 changes: 3 additions & 5 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @version:
* @Date: 2021-04-20 11:06:21
* @LastEditors: huzhushan@126.com
* @LastEditTime: 2021-11-12 11:28:20
* @LastEditTime: 2021-11-15 09:48:29
* @Author: huzhushan@126.com
* @HomePage: https://huzhushan.gitee.io/vue3-element-admin
* @Github: https://github.com/huzhushan/vue3-element-admin
Expand Down Expand Up @@ -112,10 +112,8 @@ export default defineComponent({
} else {
router.push('/')
}
if (store.state.app.authorization) {
store.dispatch('app/clearToken')
}
store.commit('app/setToken', data)

store.dispatch('app/setToken', data)
} else {
ctx.$message.error(message)
}
Expand Down

0 comments on commit 543a821

Please sign in to comment.