diff --git a/src/router/index.js b/src/router/index.js index 56f5bc7..2dcbced 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -31,7 +31,7 @@ const routes = [ const router = createRouter({ history: createWebHistory(process.env.BASE_URL), // history: createWebHistory("/"), - mode: "hash", + mode: "history", // base: process.env.BASE_URL, routes }) diff --git a/vue.config.js b/vue.config.js index 3e08efb..7cf7497 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,7 +2,8 @@ const { defineConfig } = require('@vue/cli-service') const path = require('path') module.exports = defineConfig({ - publicPath: process.env.NODE_ENV === 'production' ? './' : '/', + // publicPath: process.env.NODE_ENV === 'production' ? './' : '/', + publicPath: '/', configureWebpack: { resolve: { alias: { @@ -41,11 +42,11 @@ module.exports = defineConfig({ proxy: { '/Api': { target: 'https://app.gter.net',//请求的接口的前缀 - changeOrigin:true, + changeOrigin: true, ws: true, //用于支持websocket rewrite: (path) => path.replace(/^\/Api/, ''), - pathRewrite:{ - '^/Api':'' + pathRewrite: { + '^/Api': '' } } }