mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: dump UiContext & UserContext
This commit is contained in:
1 parent
900cce3614
commit
a33708cd21
2 files changed
+5
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.29.2",
|
||||
"version": "2.29.3",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -558,6 +558,10 @@ export class Handler extends HandlerCommon {
|
||||
this.request.json || this.response.redirect
|
||||
|| this.request.query.noTemplate || !this.response.template) {
|
||||
try {
|
||||
if (typeof this.response.body === 'object') {
|
||||
this.response.body.UiContext = this.UiContext;
|
||||
this.response.body.UserContext = this.user;
|
||||
}
|
||||
this.response.body = JSON.stringify(this.response.body, serializer);
|
||||
} catch (e) {
|
||||
this.response.body = new SystemError('Serialize failure', e.message);
|
||||
|
||||
Reference in new issue
Block a user