core: allow switch account

This commit is contained in:
undefined committed 2021-10-28 13:43:55 +08:00
1 parent 7ca2881787
commit 89424ec9cd
7 files changed
+71 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.1.13",
"version": "3.1.14",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+9
View File
@@ -115,10 +115,19 @@ export class FSDownloadHandler extends Handler {
}
}
export class SwitchAccountHandler extends Handler {
@param('uid', Types.Int)
async get(domainId: string, uid: number) {
this.session.uid = uid;
this.back();
}
}
export async function apply() {
Route('switch_language', '/language/:lang', SwitchLanguageHandler);
Route('home_files', '/file', FilesHandler, PRIV.PRIV_CREATE_FILE);
Route('fs_download', '/file/:uid/:filename', FSDownloadHandler);
Route('switch_account', '/account', SwitchAccountHandler, PRIV.PRIV_EDIT_SYSTEM);
}
global.Hydro.handler.misc = apply;