From 9968bcf674cdfce5ce831501a07100cee8370254 Mon Sep 17 00:00:00 2001 From: ywk <317226901@qq.com> Date: Wed, 9 Apr 2025 16:59:40 +0800 Subject: [PATCH] =?UTF-8?q?chore(env):=20=E7=9B=B8=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=9B=BF=E6=8D=A2=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- vue.config.js | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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