Browse Source

更改路由模式为hash模式

tongshangming 3 months ago
parent
commit
88c92a4aeb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/router/index.ts

+ 2 - 2
src/router/index.ts

@@ -1,10 +1,10 @@
-import { createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHashHistory } from 'vue-router'
 import constantRouter from './constantRouter'
 import constantRouter from './constantRouter'
 import createRouterGuard from './guard'
 import createRouterGuard from './guard'
 export { default as asyncRouter } from './asyncRouter'
 export { default as asyncRouter } from './asyncRouter'
 
 
 const router = createRouter({
 const router = createRouter({
-  history: createWebHistory(import.meta.env.BASE_URL),
+  history: createWebHashHistory(import.meta.env.BASE_URL),
   routes: [...constantRouter]
   routes: [...constantRouter]
 })
 })