mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
题目搜索,收藏功能
This commit is contained in:
1 parent
a248425db6
commit
441eeadaf3
23 files changed
+158
-97
No files matched your search
@@ -102,7 +102,7 @@ class TrainingDetailHandler extends TrainingHandler {
|
||||
const tdoc = await training.get(domainId, tid);
|
||||
const pids = training.getPids(tdoc);
|
||||
const f = this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN) ? {} : { hidden: false };
|
||||
const [udoc, pdict] = await Promise.all([
|
||||
const [owner, pdict] = await Promise.all([
|
||||
user.getById(domainId, tdoc.owner),
|
||||
problem.getList(domainId, pids, f),
|
||||
]);
|
||||
@@ -146,7 +146,7 @@ class TrainingDetailHandler extends TrainingHandler {
|
||||
];
|
||||
this.response.template = 'training_detail.html';
|
||||
this.response.body = {
|
||||
path, tdoc, tsdoc, pids, pdict, psdict, ndict, nsdict, udoc,
|
||||
path, tdoc, tsdoc, pids, pdict, psdict, ndict, nsdict, owner,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ class TrainingCreateHandler extends TrainingHandler {
|
||||
}
|
||||
const tid = await training.add(domainId, title, content, this.user._id, dag, description);
|
||||
this.response.body = { tid };
|
||||
this.response.redirect = `/t/${tid}`;
|
||||
this.response.redirect = this.url('training_detail', { tid });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ class TrainingEditHandler extends TrainingHandler {
|
||||
title, content, dag, description,
|
||||
});
|
||||
this.response.body = { tid };
|
||||
this.response.redirect = `/t/${tid}`;
|
||||
this.response.redirect = this.url('training_detail', { tid });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user