|
|
|
@ -7,7 +7,7 @@
@@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
import type { RouteRecordRaw } from 'vue-router'; |
|
|
|
|
import type { App } from 'vue'; |
|
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router'; |
|
|
|
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'; |
|
|
|
|
import { basicRoutes } from './routes'; |
|
|
|
|
import { formatUrlParamsMenu } from '/@/router/helper/menuHelper'; |
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
@ -21,7 +21,7 @@ const getRouteNames = (array: any[]) => array.forEach((item) => {
@@ -21,7 +21,7 @@ const getRouteNames = (array: any[]) => array.forEach((item) => {
|
|
|
|
|
|
|
|
|
|
/** 应用配置的静态路由 */ |
|
|
|
|
export const router = createRouter({ |
|
|
|
|
history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), |
|
|
|
|
history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH), |
|
|
|
|
routes: basicRoutes as unknown as RouteRecordRaw[], |
|
|
|
|
strict: true, |
|
|
|
|
scrollBehavior: () => ({ left: 0, top: 0 }), |
|
|
|
@ -42,7 +42,7 @@ export function setupRouter(app: App<Element>) {
@@ -42,7 +42,7 @@ export function setupRouter(app: App<Element>) {
|
|
|
|
|
app.use(router); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 解析格式化路由占位符 */ |
|
|
|
|
/** 解析格式化路由占位符 */ |
|
|
|
|
export function formatRouterPlaceholder(path: string) { |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
return formatUrlParamsMenu(path, { |
|
|
|
|