拆分域管理与系统管理

This commit is contained in:
masnn committed 2020-06-04 13:27:44 +08:00
1 parent 385e46ae42
commit faec4744d7
24 files changed
+249 -168

No files matched your search

+8 -1
View File
@@ -32,7 +32,13 @@ class StatusHandler extends Handler {
class StatusUpdateHandler extends Handler {
async post(args) {
this.checkPerm(PERM_JUDGE);
await coll.updateOne({ _id: args._id }, { $set: args }, { upsert: true });
await coll.updateOne({ _id: args._id }, { $set: { ...args, type: 'judger' } }, { upsert: true });
}
}
class SwitchLanguageHandler extends Handler {
async get({ lang }) {
this.session.language = lang;
}
}
@@ -41,6 +47,7 @@ async function apply() {
Route('/fs/:id/:name/:secret', FileDownloadHandler);
Route('/status', StatusHandler);
Route('/status/update', StatusUpdateHandler);
Route('/language/:lang', SwitchLanguageHandler);
}
global.Hydro.handler.misc = module.exports = {