Browse Source

更新镜像服务id

dev_trial
巴林闲侠 2 years ago
parent
commit
73fa9b77ca
  1. 8
      code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js

8
code/VideoAccess-VCMP/api/app/lib/controllers/mirror/index.js

@ -168,15 +168,17 @@ async function refreshId (ctx) {
if (!mirrorId) throw '更新镜像服务ID失败'; if (!mirrorId) throw '更新镜像服务ID失败';
await models.MirrorTree.update({ const nextId = timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`)
mid: timeNow.format(`ssmmHHDDMMYY${Math.floor(Math.random() * 89 + 10)}`) await models.Mirror.update({
mid: nextId
}, { }, {
where: { where: {
id: mirrorId id: mirrorId
} }
}) })
ctx.status = 204; ctx.status = 200;
ctx.body = { mid: nextId }
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400; ctx.status = 400;

Loading…
Cancel
Save