From 8915f0081d9761e990032496081468580a1fa5ca Mon Sep 17 00:00:00 2001 From: bb_pan Date: Fri, 14 Feb 2025 11:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8F=E6=BA=90=E6=89=93=E5=8C=85=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 ++ src/router/index.js | 3 ++- vue.config.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.production b/.env.production index a1a9352f..ff689425 100644 --- a/.env.production +++ b/.env.production @@ -6,3 +6,5 @@ ENV = 'production' # 安徽机械化装备共享平台/生产环境 VUE_APP_BASE_API = '/prod-api' +# 宏源 +# VUE_APP_BASE_API = '/iws/jxhzb-api' \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 95847995..a102b6a6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -198,7 +198,8 @@ Router.prototype.replace = function push(location) { export default new Router({ mode: 'history', // 去掉url中的# + mode: 'hash', // 宏源 scrollBehavior: () => ({ y: 0 }), routes: constantRoutes, - base: process.env.NODE_ENV === 'production' ? '/iws/glweb' : '', + base: process.env.NODE_ENV === 'production' ? '/iws/glweb' : '', // 宏源打包时隐藏 }) diff --git a/vue.config.js b/vue.config.js index 4ec68aa4..af163037 100644 --- a/vue.config.js +++ b/vue.config.js @@ -19,6 +19,7 @@ module.exports = { // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。 publicPath: process.env.NODE_ENV === 'production' ? '/iws/glweb/' : '/', + // publicPath: process.env.NODE_ENV === 'production' ? './' : './', // 宏源 // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) outputDir: 'dist', // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)