From a685abac4034a26964dda4b47bebcd171b2b6e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Fri, 15 Dec 2023 19:42:04 +0800 Subject: [PATCH] feat:fix bugs --- api/app/lib/controllers/projectBind/projectBind.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/projectBind/projectBind.js b/api/app/lib/controllers/projectBind/projectBind.js index 67ec248..c4e869b 100644 --- a/api/app/lib/controllers/projectBind/projectBind.js +++ b/api/app/lib/controllers/projectBind/projectBind.js @@ -63,8 +63,12 @@ async function addorEditRelation(ctx, next) { err='所选安心云结构物和巡检结构物重复!!!' throw '所选安心云结构物和巡检结构物重复!!!' } - await models.ProjectBind.update({ axyProjectId, structrueId }, { where: { id } }) + await models.ProjectBind.update({ axyProjectId, structureId:structrueId }, { where: { id } }) + ctx.status = 204 + ctx.body = { + message: '编辑成功!!', + } } else { //新增 const res= await models.ProjectBind.findOne({ where: { axyProjectId,structureId:structrueId } }) @@ -74,6 +78,9 @@ async function addorEditRelation(ctx, next) { } await models.ProjectBind.create({ axyProjectId, structureId:structrueId }) ctx.status = 204 + ctx.body = { + message: '新增成功!!', + } } } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)