2024-05-08 13:43:24 +08:00
|
|
|
|
import { statisticRoutes } from '@/router/module/statisticRoutes';
|
|
|
|
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
|
2024-05-09 14:55:40 +08:00
|
|
|
|
import { pageRoutes } from './module/pageRoutes';
|
2024-05-08 13:43:24 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* * 如果需要打包成app,则要将路由改为Hash路由,createWebHashHistory
|
|
|
|
|
* * 如果不需要 createWebHistory
|
|
|
|
|
*/
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
history:
|
2024-05-08 16:02:48 +08:00
|
|
|
|
process.env.NODE_ENV === 'production'
|
|
|
|
|
? createWebHashHistory(import.meta.env.BASE_URL)
|
|
|
|
|
: createWebHistory(import.meta.env.BASE_URL),
|
2024-05-09 14:55:40 +08:00
|
|
|
|
routes: [...pageRoutes, ...statisticRoutes],
|
2024-05-08 13:43:24 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default router;
|