mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-05 08:57:10 +08:00
refactor: 优化路由守卫代码(同步 GiDemo 更新)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { useRouteStore } from '@/stores'
|
||||
import { constantRoutes, systemRoutes } from '@/router/route'
|
||||
import { setupRouterGuard } from '@/router/guard'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -8,6 +9,8 @@ const router = createRouter({
|
||||
scrollBehavior: () => ({ left: 0, top: 0 }),
|
||||
})
|
||||
|
||||
setupRouterGuard(router)
|
||||
|
||||
/**
|
||||
* @description 重置路由
|
||||
* @description 注意:所有动态路由路由必须带有 name 属性,否则可能会不能完全重置干净
|
||||
|
||||
Reference in New Issue
Block a user