Replace top-bar module navigation with a card home page, persist favorites via API, reopen favorite tabs on cold login, and enable portal multi-tabs with overflow-based eviction. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
764 B
TypeScript
Executable File
24 lines
764 B
TypeScript
Executable File
import type { App } from 'vue'
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
import { staticRoutes } from './routes/staticRoutes'
|
|
import { configureNProgress } from '@/utils/router'
|
|
import { setupBeforeEachGuard } from './guards/beforeEach'
|
|
import { setupAfterEachGuard } from './guards/afterEach'
|
|
|
|
// 创建路由实例
|
|
export const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes: staticRoutes // 静态路由
|
|
})
|
|
|
|
// 初始化路由
|
|
export function initRouter(app: App<Element>): void {
|
|
configureNProgress() // 顶部进度条
|
|
setupBeforeEachGuard(router) // 路由前置守卫
|
|
setupAfterEachGuard(router) // 路由后置守卫
|
|
app.use(router)
|
|
}
|
|
|
|
// 门户菜单启动器首页
|
|
export const HOME_PAGE_PATH = '/home'
|