mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
refactor(ui): 无权限页面调整
This commit is contained in:
parent
1ee1a8d6d9
commit
e76b49afd2
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user