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: '', } }