style:字典
Showing
1 changed file
with
3 additions
and
4 deletions
| ... | @@ -24,10 +24,6 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -24,10 +24,6 @@ router.beforeEach(async (to, from, next) => { |
| 24 | if (!hasUser) { | 24 | if (!hasUser) { |
| 25 | store.dispatch("user/getUserInfo"); | 25 | store.dispatch("user/getUserInfo"); |
| 26 | } | 26 | } |
| 27 | //加载字典 | ||
| 28 | if (!hasAddDict) { | ||
| 29 | store.dispatch("dict/generateDic"); | ||
| 30 | } | ||
| 31 | if (hasAddRoute) { | 27 | if (hasAddRoute) { |
| 32 | next(); | 28 | next(); |
| 33 | } else { | 29 | } else { |
| ... | @@ -42,6 +38,9 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -42,6 +38,9 @@ router.beforeEach(async (to, from, next) => { |
| 42 | { path: "*", redirect: "/404", hidden: true }, | 38 | { path: "*", redirect: "/404", hidden: true }, |
| 43 | ]); | 39 | ]); |
| 44 | const routeTo = Cookies.get("routerTo"); | 40 | const routeTo = Cookies.get("routerTo"); |
| 41 | if (!hasAddDict) { | ||
| 42 | await store.dispatch("dict/generateDic"); | ||
| 43 | } | ||
| 45 | if (routeTo && routeTo !== "/") { | 44 | if (routeTo && routeTo !== "/") { |
| 46 | next({ ...to, replace: true }); | 45 | next({ ...to, replace: true }); |
| 47 | } else { | 46 | } else { | ... | ... |
-
Please register or sign in to post a comment