RAGflow/management/web/src/router/config.ts

42 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-03-28 22:45:42 +08:00
import type { RouterHistory } from "vue-router"
import { createWebHashHistory, createWebHistory } from "vue-router"
/** 路由配置 */
interface RouterConfig {
/**
* @name
* @description hash html5
*/
history: RouterHistory
/**
* @name
* @description 1. roles
* @description 2. dynamic: false
*/
dynamic: boolean
/**
* @name
* @description
* @description 1. 访
* @description 2.
*/
defaultRoles: Array<string>
/**
* @name
* @description 1.
* @description 2.
*/
thirdLevelRouteCache: boolean
}
const VITE_ROUTER_HISTORY = import.meta.env.VITE_ROUTER_HISTORY
const VITE_PUBLIC_PATH = import.meta.env.VITE_PUBLIC_PATH
export const routerConfig: RouterConfig = {
history: VITE_ROUTER_HISTORY === "hash" ? createWebHashHistory(VITE_PUBLIC_PATH) : createWebHistory(VITE_PUBLIC_PATH),
dynamic: true,
defaultRoles: ["DEFAULT_ROLE"],
thirdLevelRouteCache: false
}