core: fix UserContext json

This commit is contained in:
undefined committed 2022-08-28 00:20:48 +08:00
1 parent 6e4e2d5ecf
commit 00bc92a2e1
4 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.16.4",
"version": "3.16.5",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
@@ -12,11 +12,10 @@ const serializer = (showDisplayName = false) => (k: string, v: any) => {
};
export default (logger) => async (ctx: KoaContext, next) => {
const {
request, response, UiContext, user, args,
} = ctx.HydroContext;
const { request, response } = ctx.HydroContext;
try {
await next();
const { UiContext, user, args } = ctx.HydroContext;
if (response.redirect) {
response.body ||= {};
response.body.url = response.redirect;
+1
View File
@@ -67,6 +67,7 @@ export async function saveConfig(config: any) {
}
export async function setConfig(key: string, value: any) {
const path = key.split('.');
if (path.filter((i) => ['__proto__', 'prototype'].includes(i)).length) throw new Error('Invalid key');
const t = path.pop();
let cursor = systemConfig;
for (const p of path) {
+3
View File
@@ -6,6 +6,9 @@
"main": "hydro.js",
"repository": "https://github.com/hydro-dev/Hydro.git",
"preferUnplugged": true,
"scripts": {
"lint": "eslint"
},
"devDependencies": {
"@blueprintjs/core": "^4.9.3",
"@fontsource/dm-mono": "^4.5.9",