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;