yeguodong 2 months ago
parent
commit
087ec9a43b
3 changed files with 4 additions and 2 deletions
  1. 1 0
      .gitignore
  2. 2 2
      src/router/index.js
  3. 1 0
      vite.config.js

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+.idea
 node_modules
 .DS_Store
 dist

+ 2 - 2
src/router/index.js

@@ -1,4 +1,4 @@
-import { createRouter, createWebHistory } from 'vue-router'
+import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'
 
 export const constantRoutes = [
   {
@@ -567,7 +567,7 @@ export const constantRoutes = [
 ]
 
 const router = createRouter({
-  history: createWebHistory(),
+  history: createWebHashHistory('/wxservice/'),
   routes: constantRoutes,
 })
 

+ 1 - 0
vite.config.js

@@ -11,6 +11,7 @@ const alias = {
 }
 
 export default defineConfig({
+  base: '/wxservice/',
   resolve: {
     alias,
     extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']