|
@@ -1,4 +1,4 @@
|
|
|
-import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
|
|
|
+import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router';
|
|
|
import NProgress from 'nprogress';
|
|
|
import 'nprogress/nprogress.css';
|
|
|
import { store } from '/@/store/index';
|
|
@@ -17,7 +17,8 @@ const whiteList = ['/login', '/ssoBack']
|
|
|
* @link 参考:https://next.router.vuejs.org/zh/api/#createrouter
|
|
|
*/
|
|
|
const router = createRouter({
|
|
|
- history: createWebHistory(),
|
|
|
+ // 如果使用 golocal 打包,则路由使用 hash 模式
|
|
|
+ history: import.meta.env.VITE_ROUTER_MODE === 'hash' ? createWebHashHistory() : createWebHistory(),
|
|
|
routes: staticRoutes,
|
|
|
});
|
|
|
|