feat:设置跨域代理

This commit is contained in:
eric
2023-12-03 19:11:19 +08:00
parent 19b4aa7960
commit 7195361a4f
3 changed files with 81 additions and 8 deletions

View File

@@ -67,9 +67,24 @@ const config = {
router: {
mode: 'browser', // 或者是 'browser'
},
// defineConstants: {
// HOST: '"/api"'
// },
// devServer: {
// proxy: {
// '/api/': {
// target: JSON.parse('"http://localhost:8082"'),
// pathRewrite: {
// '^/api/': '/'
// },
// changeOrigin: true
// }
// }
// }
}
}
module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))