From d988be8cd405da649184d36fb3e71607e0b72b59 Mon Sep 17 00:00:00 2001 From: "gaoxiaolin.gao" Date: Tue, 24 Jul 2018 15:38:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9project=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + server/controllers/project.js | 41 ++--------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb17a4a..ed567905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ #### Bug Fixed * 优化ldap登陆 +* swagger 导入公共params ### v1.3.20 diff --git a/server/controllers/project.js b/server/controllers/project.js index c0582ad6..22dd57b9 100755 --- a/server/controllers/project.js +++ b/server/controllers/project.js @@ -811,45 +811,8 @@ class projectController extends baseController { let data = { up_time: yapi.commons.time() }; - if (params.project_type) { - data.project_type = params.project_type; - } - if (!_.isUndefined(params.name)) { - data.name = params.name; - } - if (!_.isUndefined(params.desc)) { - data.desc = params.desc; - } - if (!_.isUndefined(params.group_id)) { - data.group_id = params.group_id; - } - if (!_.isUndefined(params.basepath)) { - data.basepath = params.basepath; - } - if (!_.isUndefined(params.switch_notice)) { - data.switch_notice = params.switch_notice; - } - if (!_.isUndefined(params.color)) { - data.color = params.color; - } - if (!_.isUndefined(params.icon)) { - data.icon = params.icon; - } - if (!_.isUndefined(params.pre_script)) { - data.pre_script = params.pre_script; - } - if (!_.isUndefined(params.after_script)) { - data.after_script = params.after_script; - } - - if(!_.isUndefined(params.project_mock_script)) { - data.project_mock_script = params.project_mock_script; - } - - if(!_.isUndefined(params.is_mock_open)) { - data.is_mock_open = params.is_mock_open; - } + data = Object.assign({}, data, params); let result = await this.Model.up(id, data); let username = this.getUsername(); @@ -951,7 +914,7 @@ class projectController extends baseController { // } let env = await this.Model.getByEnv(project_id); - // console.log('project', projectData) + ctx.body = yapi.commons.resReturn(env); } catch (e) {