mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 17:28:24 +08:00
23 lines
684 B
TypeScript
Executable File
23 lines
684 B
TypeScript
Executable File
import { loadingFadeOut } from 'virtual:app-loading'
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
import pinia from '@/store'
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
import setupExtensions from './extensions'
|
|
import setupGuards from './guards'
|
|
// 路由相关数据
|
|
import { constantRoutes, constantRoutesByFilesystem } from './routes'
|
|
|
|
const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes: useSettingsStore(pinia).settings.app.routeBaseOn === 'filesystem' ? constantRoutesByFilesystem : constantRoutes,
|
|
})
|
|
|
|
setupGuards(router)
|
|
setupExtensions(router)
|
|
|
|
router.isReady().then(() => {
|
|
loadingFadeOut()
|
|
})
|
|
|
|
export default router
|