This commit is contained in:
2026-03-27 19:16:27 +08:00
parent 09d0113569
commit 893bb2a0f2

View File

@@ -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') const { defineConfig } = require('@vue/cli-service')
module.exports = {
devServer: { module.exports = defineConfig(() => {
port: 8081, const NODE_ENV = 'development'
proxy: {
'/api': { return {
target: 'http://47.105.32.17:8888', devServer: {
changeOrigin: true, port: 8081,
pathRewrite: { proxy: {
'^/api': '' '/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',
} }
} })