From 46d92f16dd5296a2753bc396b55b00e5546cd3a1 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Thu, 13 Jul 2023 11:58:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- vue.config.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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': '' } } }