From ae4680770acfd71eaf7c84fd2d97e91cfe8425c4 Mon Sep 17 00:00:00 2001 From: hooray <304327508@qq.com> Date: Wed, 11 Nov 2020 00:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=B7=E6=B1=82=E4=BB=A3?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 +- vue.config.js | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 9f6e4055..8c3f674b 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -14,7 +14,7 @@ const toLogin = () => { } const api = axios.create({ - baseURL: process.env.NODE_ENV !== 'development' && process.env.VUE_APP_API_ROOT, + baseURL: process.env.VUE_APP_API_ROOT, timeout: 10000, responseType: 'json' // withCredentials: true diff --git a/vue.config.js b/vue.config.js index 0d90e561..4e96fcb4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -54,13 +54,12 @@ module.exports = { productionSourceMap: false, devServer: { open: true, - // 开发环境默认开启反向代理,如果不需要请自行注释 - proxy: { - '/': { - target: process.env.VUE_APP_API_ROOT, - changeOrigin: true - } - } + // proxy: { + // '/': { + // target: process.env.VUE_APP_API_ROOT, + // changeOrigin: true + // } + // } }, configureWebpack: config => { config.resolve.modules = ['node_modules', 'assets/sprites']