From 893bb2a0f2786eaa0d232eeed9c32737526001a6 Mon Sep 17 00:00:00 2001 From: guoguo <2534966410@qq.com> Date: Fri, 27 Mar 2026 19:16:27 +0800 Subject: [PATCH] 1 --- vue.config.js | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/vue.config.js b/vue.config.js index 58cc089..61d07a5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,15 +1,40 @@ +// module.exports = { +// devServer: { +// port: 8081, +// proxy: { +// '/api': { +// target: 'http://47.105.32.17:8888', +// changeOrigin: true, +// pathRewrite: { +// '^/api': '' +// } +// } +// } +// } +// } + const { defineConfig } = require('@vue/cli-service') -module.exports = { - devServer: { - port: 8081, - proxy: { - '/api': { - target: 'http://47.105.32.17:8888', - changeOrigin: true, - pathRewrite: { - '^/api': '' + +module.exports = defineConfig(() => { + const NODE_ENV = 'development' + + return { + devServer: { + port: 8081, + proxy: { + '/api': { + // target: 'http://47.105.32.17:8888', + target: 'http://10.157.100.138:8888', + changeOrigin: true, + pathRewrite: { '^/api': '' } } } - } + }, + + // 公共路径:生产环境加 /pc/,开发环境用 / + publicPath: NODE_ENV === 'production' ? '/pc/' : '/', + outputDir: 'dist', + assetsDir: 'assets', + } -} \ No newline at end of file +}) \ No newline at end of file