From 73fa9b77caf8d21ac027a0098f214c7e0d1d665a Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 6 Dec 2022 10:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=95=9C=E5=83=8F=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/app/lib/controllers/mirror/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js index 4fa9221..e10c3e6 100644 --- a/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js +++ b/code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js @@ -168,15 +168,17 @@ async function refreshId (ctx) { if (!mirrorId) throw '更新镜像服务ID失败'; - await models.MirrorTree.update({ - mid: timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`) + const nextId = timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`) + await models.Mirror.update({ + mid: nextId }, { where: { id: mirrorId } }) - ctx.status = 204; + ctx.status = 200; + ctx.body = { mid: nextId } } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: error`); ctx.status = 400;