From f817dc200523d84bab511f9c548b35b98aa54d8e Mon Sep 17 00:00:00 2001 From: bb_pan Date: Sat, 3 Jan 2026 10:47:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 ++-- vue.config.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 36bb4177..4116e178 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -400,8 +400,8 @@ Router.prototype.replace = function push(location) { } export default new Router({ - mode: 'hash', // 去掉url中的# / 宏源为hash + mode: process.env.VUE_APP_BASE_API == '/iws/jiju-api' ? 'hash' : 'history', // 宏源: hash scrollBehavior: () => ({ y: 0 }), routes: constantRoutes, - base: process.env.NODE_ENV === 'production' ? '/iws/glweb/' : '/iws/glweb/' // 宏源打包时隐藏 + base: process.env.VUE_APP_BASE_API == '/iws/jiju-api' ? '/iws/glweb/' : '/' // 宏源打包时隐藏 }) diff --git a/vue.config.js b/vue.config.js index 1b1b01e3..7f3f1daf 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,7 +18,7 @@ module.exports = { // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。 - publicPath: process.env.NODE_ENV === 'production' ? '/iws/glweb/' : '/', // 宏源打包时无需更改 + publicPath: process.env.VUE_APP_BASE_API == '/iws/jiju-api' ? '/iws/glweb/' : '/', // 宏源打包时无需更改 // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) outputDir: 'dist', // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)