diff --git a/supervise-flowable-ui/.env.development b/supervise-flowable-ui/.env.development index e69de29b..b7a1e5e8 100644 --- a/supervise-flowable-ui/.env.development +++ b/supervise-flowable-ui/.env.development @@ -0,0 +1,8 @@ +# 开发环境配置 +ENV = 'development' + +# 若依管理系统/开发环境 +VUE_APP_BASE_API = '/api' +VUE_APP_URL = "http://127.0.0.1:7001" +# 路由懒加载 +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/supervise-flowable-ui/.env.production b/supervise-flowable-ui/.env.production index e69de29b..943dc35f 100644 --- a/supervise-flowable-ui/.env.production +++ b/supervise-flowable-ui/.env.production @@ -0,0 +1,6 @@ +# 生产环境配置 +ENV = 'production' + +# 若依管理系统/生产环境 +VUE_APP_BASE_API = '/api' +VUE_APP_URL = "http://jianguan.yyundong.com/" diff --git a/supervise-flowable-ui/vue.config.js b/supervise-flowable-ui/vue.config.js index 72413f28..e3f2fb9f 100644 --- a/supervise-flowable-ui/vue.config.js +++ b/supervise-flowable-ui/vue.config.js @@ -33,12 +33,20 @@ module.exports = { open: true, proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy - [process.env.VUE_APP_BASE_API]: { + /*[process.env.VUE_APP_BASE_API]: { target: `http://localhost:7001`, // 改成自己的接口地址 changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } + }*/ + '/api': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://192.168.1.109:8111', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/api': '' + } } }, disableHostCheck: true