mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
a11y: init
This commit is contained in:
3 files changed
+14
-4
No files matched your search
+2
-4
@@ -80,10 +80,8 @@ If you have any questions about the migration process, please add QQ group 10858
|
||||
|
||||
const installAsJudge = process.argv.includes('--judge');
|
||||
const noCaddy = process.argv.includes('--no-caddy');
|
||||
const installTarget = installAsJudge
|
||||
? '@hydrooj/hydrojudge'
|
||||
: 'hydrooj @hydrooj/hydrojudge @hydrooj/ui-default @hydrooj/fps-importer';
|
||||
const addons = ['@hydrooj/ui-default', '@hydrooj/hydrojudge', '@hydrooj/fps-importer'];
|
||||
const addons = ['@hydrooj/ui-default', '@hydrooj/hydrojudge', '@hydrooj/fps-importer', '@hydrooj/a11y'];
|
||||
const installTarget = installAsJudge ? '@hydrooj/hydrojudge' : `hydrooj ${addons.join(' ')}`;
|
||||
const substitutersArg = process.argv.find((i) => i.startsWith('--substituters='));
|
||||
const substituters = substitutersArg ? substitutersArg.split('=')[1].split(',') : [];
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Context, UserModel } from 'hydrooj';
|
||||
|
||||
export async function apply(ctx: Context) {
|
||||
// Auto authorize user 2 as super admin
|
||||
ctx.on('handler/after/UserRegisterWithCode#post', async (that) => {
|
||||
if (that.session.uid === 2) await UserModel.setSuperAdmin(2);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "@hydrooj/a11y",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
Reference in new issue
Block a user