From 55910894f90048278de179c8c94e0b87d1af44a6 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 30 May 2022 15:19:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=B1=BB=E5=9E=8B=E7=9A=84=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=97=B6=E4=BF=A1=E6=81=AF=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013205 --user=李玉号 【系统设置】github#13600,从项目A导出的环境信息,在项目B导入后,在Http配置tab页出现header信息丢失 https://www.tapd.cn/55049933/s/1168244 Closes #13600 --- .../business/components/project/menu/EnvironmentList.vue | 8 +++++--- .../settings/workspace/environment/EnvironmentList.vue | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/project/menu/EnvironmentList.vue b/frontend/src/business/components/project/menu/EnvironmentList.vue index 726cbce009..83924cc86a 100644 --- a/frontend/src/business/components/project/menu/EnvironmentList.vue +++ b/frontend/src/business/components/project/menu/EnvironmentList.vue @@ -348,9 +348,11 @@ export default { if (env.config) { //旧环境可能没有config数据 let tempConfig = JSON.parse(env.config); if (tempConfig.httpConfig.conditions && tempConfig.httpConfig.conditions.length > 0) { - tempConfig.httpConfig.conditions = tempConfig.httpConfig.conditions.filter(condition => { //删除”模块启用条件“,因为导入导出环境对应的项目不同,模块也就不同, - return condition.type !== 'MODULE'; - }); + tempConfig.httpConfig.conditions.map(condition => { + if (condition.type === 'MODULE') { + condition.details = []; + } + }) env.config = JSON.stringify(tempConfig); } } diff --git a/frontend/src/business/components/settings/workspace/environment/EnvironmentList.vue b/frontend/src/business/components/settings/workspace/environment/EnvironmentList.vue index 0791788f1d..8899c895ab 100644 --- a/frontend/src/business/components/settings/workspace/environment/EnvironmentList.vue +++ b/frontend/src/business/components/settings/workspace/environment/EnvironmentList.vue @@ -394,9 +394,11 @@ export default { if (env.config) { //旧环境可能没有config数据 let tempConfig = JSON.parse(env.config); if (tempConfig.httpConfig.conditions && tempConfig.httpConfig.conditions.length > 0) { - tempConfig.httpConfig.conditions = tempConfig.httpConfig.conditions.filter(condition => { //删除”模块启用条件“,因为导入导出环境对应的项目不同,模块也就不同, - return condition.type !== 'MODULE'; - }); + tempConfig.httpConfig.conditions.map(condition => { + if (condition.type === 'MODULE') { + condition.details = []; + } + }) env.config = JSON.stringify(tempConfig); } }