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失败';
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;

Loading…
Cancel
Save