From 24c1294aad8a060b49deaf411843511bc9b2461e Mon Sep 17 00:00:00 2001 From: yuan_yi <1650192445@qq.com> Date: Fri, 27 May 2022 17:27:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=BF=83=E4=BA=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/app/lib/controllers/camera/index.js | 6 ++++-- .../VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js index 26f4f46..04cb2cd 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js @@ -62,7 +62,7 @@ async function getCameraProject (ctx, next) { const axbindCameraRes = await ctx.app.fs.axyRequest.get('vcmp/camera/project', { query: { token, cameraId: cameraIds.join(',') } }) // 查对应创建者信息 - const corUsers = await ctx.app.fs.authRequest.get(`user/${[...createUserIds].join(',')}/message`, { query: { token } }) + const corUsers = await ctx.app.fs.authRequest.get(`user/${[...createUserIds].join(',') || -1}/message`, { query: { token } }) for (let { dataValues: camera } of cameraRes) { const corBindCamera = axbindCameraRes.find(b => b.cameraId == camera.id) @@ -226,7 +226,9 @@ async function del (ctx) { } }) - await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraId.join(',') } }) + if (cameraId.length) { + await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraId.join(',') } }) + } ctx.status = 204; } catch (error) { diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js index edc9da9..c8ec9e9 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js @@ -140,8 +140,9 @@ async function del (ctx, next) { nvrId, } }) - - await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraIds.join(',') } }) + if(cameraIds.length){ + await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraIds.join(',') } }) + } await transaction.commit(); ctx.status = 204; @@ -205,7 +206,8 @@ async function detail (ctx) { camera: cameras, createUser: { namePresent: corUser[0].namePresent - } + }, + accessWay: 'GB/T28181' } ctx.status = 200;