From 348867cf232f35af70ac4e1ac73d2eb5b072a90e Mon Sep 17 00:00:00 2001 From: zhangguoping Date: Tue, 3 Sep 2024 11:06:13 +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 --- build/webpack.prod.js | 3 +++ src/router/index.ts | 2 +- src/utils/request/env.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build/webpack.prod.js b/build/webpack.prod.js index e74f881..4b3dcf8 100644 --- a/build/webpack.prod.js +++ b/build/webpack.prod.js @@ -3,6 +3,9 @@ const baseConfig = require('./webpack.base.js') module.exports = merge(baseConfig, { mode: 'production', // 生产模式,会开启 tree-shaking 和 压缩代码,以及其他优化 + output: { + publicPath: './', + }, optimization: { splitChunks: { // 分隔代码 cacheGroups: { diff --git a/src/router/index.ts b/src/router/index.ts index 50cb5df..4d230e7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -60,7 +60,7 @@ const routePage = [ const routes = [...routePublic, ...routeTemplate, ...routePage]; const router = createRouter({ - history: createWebHistory(), + history: createWebHistory('/yxh5/'), routes, }); diff --git a/src/utils/request/env.ts b/src/utils/request/env.ts index 965f100..e9d4fe6 100644 --- a/src/utils/request/env.ts +++ b/src/utils/request/env.ts @@ -6,7 +6,7 @@ const defaultConfig: any = { VITE_LOGIN_PATH: '', }, 'production': { - VITE_BASE_API: '/adminyx', + VITE_BASE_API: '/yxh5api', VITE_LOGIN_PATH: '', } }