mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "2.29.2",
|
"version": "2.29.3",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -558,6 +558,10 @@ export class Handler extends HandlerCommon {
|
|||||||
this.request.json || this.response.redirect
|
this.request.json || this.response.redirect
|
||||||
|| this.request.query.noTemplate || !this.response.template) {
|
|| this.request.query.noTemplate || !this.response.template) {
|
||||||
try {
|
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);
|
this.response.body = JSON.stringify(this.response.body, serializer);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.response.body = new SystemError('Serialize failure', e.message);
|
this.response.body = new SystemError('Serialize failure', e.message);
|
||||||
|
|||||||
Reference in new issue
Block a user