015a0fbf by 任超

style:字典

1 parent 35bbb8a2
...@@ -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 {
......