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

This commit is contained in:
廖彦棋 2024-03-14 17:49:15 +08:00
parent a3e1d8ae21
commit 6b1cd8c30c

View File

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