Commit 4747677
fix: bug 修复鉴权时GetInfo与Logout双双失效导致路由死循环
在src/permission.js鉴权时有以下流程:
1 store
2 .dispatch('GetInfo')
3 .catch(()=>{
4 store.dispatch('Logout').then(()=>{
5 next({ path: loginRoutePath, query: { redirect: to.fullPath } })
6 })
7 })
2行GetInfo的失败catch会执行触发store的Logout(4行),而Logout也失败不catch会直接resolve导致路由到loginRoutePath(5行),
loginRoutePath会再次加载src/permission.js运行store.dispatch('GetInfo'),从此死循环开始。。。1 parent a4a7e59 commit 4747677
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
0 commit comments