Browse Source

改为hash 路由模式

黄琪勇 1 year ago
parent
commit
b23bb7c3cc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/router/index.ts

+ 2 - 2
src/router/index.ts

@@ -1,4 +1,4 @@
-import { createRouter, createWebHistory } from "vue-router"
+import { createRouter, createWebHashHistory } from "vue-router"
 import { constRoutes, asyncComponents } from "./routers"
 import NProgress from "@/plugin/nprogress"
 import { ElMessage } from "element-plus"
@@ -8,7 +8,7 @@ import userStore from "@/store/modules/user"
 
 const userStoreHook = userStore()
 const router = createRouter({
-   history: createWebHistory(process.env.BASE_URL),
+   history: createWebHashHistory(process.env.BASE_URL),
    routes: constRoutes,
    scrollBehavior() {
       return { left: 0, top: 0 }