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); } }