|
@ -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; |
|
|