Admin
2022-06-30 6d5dbde08fc4c167ed253f8607d591a17f32b718
src/router/index.ts
@@ -10,6 +10,7 @@
import { staticRoutes } from '/@/router/route';
import { initFrontEndControlRoutes } from '/@/router/frontEnd';
import { initBackEndControlRoutes } from '/@/router/backEnd';
import {useUserInfo} from "/@/stores/userInfo";
@@ -87,13 +88,11 @@
         const storesRoutesList = useRoutesList(pinia);
         const { routesList } = storeToRefs(storesRoutesList);
         if (routesList.value.length === 0) {
            if (isRequestRoutes) {
               // 后端控制路由:路由数据初始化,防止刷新时丢失
               await initBackEndControlRoutes();
            await initBackEndControlRoutes();
               // 动态添加路由:防止非首页刷新时跳转回首页的问题
               // 确保 addRoute() 时动态添加的路由已经被完全加载上去
               next({ ...to, replace: true });
            }
            next({ ...to, replace: true });
         } else {
            next();
         }