refactor(ui): 无权限页面调整

This commit is contained in:
廖彦棋 2024-03-14 17:49:15 +08:00
parent 1ee1a8d6d9
commit e76b49afd2

View File

@ -10,11 +10,6 @@ const whiteListRoutes = [
name: "Login",
component: () => import("@/views/LoginView.vue"),
},
{
path: "/403",
name: "403",
component: () => import("@/views/NoPermission.vue"),
},
{
path: "/:pathMatch(.*)*",
name: "404",
@ -30,13 +25,20 @@ const router = createRouter({
name: 'home',
component: CustomLayout,
redirect: () => menu[0].path,
children: menu
children: [
{
path: "403",
name: "403",
component: () => import("@/views/NoPermission.vue"),
},
...menu
]
},
...whiteListRoutes
]
})
const whiteList = whiteListRoutes.map((i) => i.name);
const whiteList = [...whiteListRoutes.map((i) => i.name), "403"];
router.beforeEach((to, _, next) => {
const authStore = useAuthStore();