修复:允许路由在框架外显示

This commit is contained in:
1638245306
2024-09-25 23:32:35 +08:00
parent b1f9faca0f
commit 2c8b51f463
2 changed files with 6 additions and 3 deletions

View File

@@ -93,6 +93,8 @@ export function formatTwoStageRoutes(arr: any) {
return newArr;
}
const frameOutRoutes = staticRoutes.map(item => item.path)
// 路由加载前
router.beforeEach(async (to, from, next) => {
NProgress.configure({showSpinner: false});
@@ -109,8 +111,9 @@ router.beforeEach(async (to, from, next) => {
} else if (token && to.path === '/login') {
next('/home');
NProgress.done();
}else if(token && frameOutRoutes.includes(to.path) ){
next()
} else {
const storesRoutesList = useRoutesList(pinia);
const {routesList} = storeToRefs(storesRoutesList);
if (routesList.value.length === 0) {