diff --git a/.env.development b/.env.development index 302ecd1..030a2d4 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,8 @@ VUE_APP_TITLE = 若依管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = '/admin-api' +VUE_APP_GATEWAY = 'http://localhost:8090' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production index b4893b0..86fd0c6 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,5 @@ VUE_APP_TITLE = 若依管理系统 ENV = 'production' # 若依管理系统/生产环境 -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '/admin-api' +VUE_APP_GATEWAY = 'http://localhost:8080' diff --git a/.env.staging b/.env.staging index 361859f..0e7d8e7 100644 --- a/.env.staging +++ b/.env.staging @@ -7,4 +7,5 @@ NODE_ENV = production ENV = 'staging' # 若依管理系统/测试环境 -VUE_APP_BASE_API = '/stage-api' +VUE_APP_BASE_API = '/admin-api' +VUE_APP_GATEWAY = 'http://localhost:8080' diff --git a/package.json b/package.json index 963a734..f264df2 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "若依", "license": "MIT", "scripts": { - "dev": "vue-cli-service serve", + "dev": "vue-cli-service serve --mode development", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", diff --git a/vue.config.js b/vue.config.js index 8afb50b..1a77380 100644 --- a/vue.config.js +++ b/vue.config.js @@ -36,7 +36,7 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://localhost:8080`, + target: process.env.VUE_APP_GATEWAY, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''