mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
拆分域管理与系统管理
This commit is contained in:
1 parent
385e46ae42
commit
faec4744d7
24 files changed
+249
-168
No files matched your search
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user