Skip to content

Commit 45d5eec

Browse files
committed
fix: 🐛修复tokenGetUserInfo被cancel的bug
1 parent a02119c commit 45d5eec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Vue.prototype.$cookie = Cookies
3636
router.beforeEach((to, from, next) => {
3737
Vue.prototype.$message.closeAll()
3838
const CancelToken = Vue.axios.CancelToken
39-
store.state.source.cancel && store.state.source.cancel()
39+
from.matched.length && store.state.source.cancel && store.state.source.cancel()
4040
store.commit('setSource', CancelToken.source())
4141
Vue.axios.post('/views/add', {
4242
from: from.fullPath,

0 commit comments

Comments
 (0)