mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
移除可以与同一用户创建多个会话的特性
This commit is contained in:
1 parent
d04628148f
commit
3c5fdb9032
16 files changed
+120
-118
No files matched your search
+4
-16
@@ -17,22 +17,10 @@ class RecordListHandler extends Handler {
|
||||
this.response.template = 'record_main.html';
|
||||
const q = {};
|
||||
const rdocs = await record.getMany(q, { _id: -1 }, page, await system.get('RECORD_PER_PAGE'));
|
||||
const pdict = {};
|
||||
const udict = {};
|
||||
const ulist = [];
|
||||
const plist = [];
|
||||
for (const rdoc of rdocs) {
|
||||
ulist[rdoc.uid] = user.getById(rdoc.uid);
|
||||
plist[rdoc.pid] = problem.get(rdoc.pid, this.user._id);
|
||||
}
|
||||
await Promise.all(ulist);
|
||||
await Promise.all(plist);
|
||||
for (const udoc of ulist) {
|
||||
udict[udoc._id] = udoc;
|
||||
}
|
||||
for (const pdoc of plist) {
|
||||
pdict[pdoc._id] = pdoc;
|
||||
}
|
||||
const [udict, pdict] = await Promise.all([
|
||||
user.getList(rdocs.map((rdoc) => rdoc.uid)),
|
||||
problem.getList(rdocs.map((rdoc) => rdoc.pid)),
|
||||
]);
|
||||
const path = [
|
||||
['Hydro', '/'],
|
||||
['record_main', null],
|
||||
|
||||
Reference in new issue
Block a user