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')
module.exports = {
module.exports = defineConfig(() => {
const NODE_ENV = 'development'
return {
devServer: {
port: 8081,
proxy: {
'/api': {
target: 'http://47.105.32.17:8888',
// target: 'http://47.105.32.17:8888',
target: 'http://10.157.100.138:8888',
changeOrigin: true,
pathRewrite: {
'^/api': ''
pathRewrite: { '^/api': '' }
}
}
},
// 公共路径:生产环境加 /pc/,开发环境用 /
publicPath: NODE_ENV === 'production' ? '/pc/' : '/',
outputDir: 'dist',
assetsDir: 'assets',
}
}
}
})