题目搜索,收藏功能

This commit is contained in:
undefined committed 2020-06-24 13:39:32 +08:00
1 parent a248425db6
commit 441eeadaf3
23 files changed
+158 -97

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
{
"id": "migrate-vijos",
"version": "0.0.1",
"version": "1.0.0",
"description": "Migrate From Vijos"
}
+7 -1
View File
@@ -236,7 +236,13 @@ async function discussionNode(src, report) {
const category = item[0];
const nodes = item[1];
for (const node of nodes || []) {
t.push(discussion.addNode(doc.domain_id, node.name, category));
if (node.pic) {
t.push(discussion.addNode(
doc.domain_id, node.name, category, { pic: node.pic },
));
} else {
t.push(discussion.addNode(doc.domain_id, node.name, category));
}
}
}
await Promise.all(t).catch((e) => e);
+1 -1
View File
@@ -1,5 +1,5 @@
{
"id": "problem-import-syzoj",
"version": "1.0.0",
"version": "1.0.1",
"description": "Import problem from syzoj."
}
+4 -4
View File
@@ -11,8 +11,8 @@ async function syzoj(url, handler) {
const [, host, pid] = RE_SYZOJ.exec(url);
const res = await superagent.get(`${url}export`);
assert(res.status === 200, new RemoteOnlineJudgeError('Cannot connect to target server'));
assert(res.data.success, new RemoteOnlineJudgeError((res.data.error || {}).message));
const p = res.data.obj;
assert(res.body.success, new RemoteOnlineJudgeError((res.body.error || {}).message));
const p = res.body.obj;
const content = [];
if (p.description) {
content.push(
@@ -64,8 +64,8 @@ async function syzoj(url, handler) {
type: p.type,
},
};
const r = await download(`${url}testdata/download`);
const r = download(`${url}testdata/download`);
return [pdoc, r];
}
global.Hydro.lib['import.syzoj'] = syzoj;
global.Hydro.lib['import.syzoj'] = module.exports = syzoj;