diff --git a/.env.development b/.env.development index c5802ca..eeaae49 100644 --- a/.env.development +++ b/.env.development @@ -23,5 +23,5 @@ ENV = 'development' #VUE_APP_BASE_API = 'http://192.168.31.159:8080' #测试 -VUE_APP_BASE_API = 'http://t-mana.beida413.com/prod-api' +VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_API = 'http://127.0.0.1:8080' diff --git a/.env.production b/.env.production index a7f26e4..0d50c39 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ ENV = 'production' # base api -VUE_APP_BASE_API = 'http://t-mana.beida413.com/prod-api' +VUE_APP_BASE_API = '/prod-api' # 打包: # npm run build:prod diff --git a/vue.config.js b/vue.config.js index 168ccde..b6559a2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -42,7 +42,16 @@ module.exports = { warnings: false, errors: true }, - before: require('./mock/mock-server.js') + proxy: { + '/prod-api': { + target: 'http://t-mana.beida413.com', + changeOrigin: true + // pathRewrite: { + // '^/prod-api': '' + // } + } + } + // before: require('./mock/mock-server.js') }, configureWebpack: { // provide the app's title in webpack's name field, so that