mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	refactor(ui): 无权限页面调整
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user