From 8782263054b876cb02ad672e3f58a24f06f3b0ca Mon Sep 17 00:00:00 2001 From: bb_pan Date: Fri, 14 Feb 2025 18:02:50 +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 | 3 +-- vue.config.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index a102b6a6..9a4481d4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -197,8 +197,7 @@ Router.prototype.replace = function push(location) { } export default new Router({ - mode: 'history', // 去掉url中的# - mode: 'hash', // 宏源 + mode: 'history', // 去掉url中的# / 宏源为history scrollBehavior: () => ({ y: 0 }), routes: constantRoutes, base: process.env.NODE_ENV === 'production' ? '/iws/glweb' : '', // 宏源打包时隐藏 diff --git a/vue.config.js b/vue.config.js index af163037..60120e29 100644 --- a/vue.config.js +++ b/vue.config.js @@ -18,8 +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.NODE_ENV === 'production' ? './' : './', // 宏源 + publicPath: process.env.NODE_ENV === 'production' ? '/iws/glweb/' : '/', // 宏源打包时无需更改 // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) outputDir: 'dist', // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)