| | |
| | | |
| | | // 创建路由实例 |
| | | const router = createRouter({ |
| | | history: createWebHistory("/"), // createWebHashHistory URL带#,createWebHistory URL不带# |
| | | history: createWebHistory("/energy"), // createWebHashHistory URL带#,createWebHistory URL不带# |
| | | strict: true, |
| | | routes: remainingRouter as RouteRecordRaw[], |
| | | scrollBehavior: () => ({ left: 0, top: 0 }) |
| | | }) |
| | | |
| | | export const resetRouter = (): void => { |
| | | const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root'] |
| | | const resetWhiteNameList = ['Redirect', 'Login', 'NoFind', 'Root', 'Callback'] |
| | | router.getRoutes().forEach((route) => { |
| | | const { name } = route |
| | | if (name && !resetWhiteNameList.includes(name as string)) { |