From 356794bf85ce679a79f8ebbaefbd4df1904d8558 Mon Sep 17 00:00:00 2001 From: djz8236 Date: Sat, 13 May 2023 12:22:22 +0800 Subject: [PATCH] =?UTF-8?q?flowable=E9=9B=86=E6=88=90=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervise-flowable-ui/.env.development | 8 ++++++++ supervise-flowable-ui/.env.production | 6 ++++++ supervise-flowable-ui/vue.config.js | 10 +++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) 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