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
a93da2badb
commit
900e19382b
14 files changed
+120
-46
No files matched your search
@@ -34,9 +34,11 @@ class ProblemImportHandler extends Handler {
|
||||
throw new ValidationError('remoteType');
|
||||
}
|
||||
const [pdoc, testdata] = await global.Hydro.lib[`import.${remoteType}`](url, this);
|
||||
if (pid) pdoc.pid = pid;
|
||||
if (hidden) pdoc.hidden = true;
|
||||
const docId = await problem.add(domainId, pdoc.title, pdoc.content, this.user._id, pdoc);
|
||||
const docId = await problem.add(
|
||||
domainId, pid || pdoc.pid, pdoc.title, pdoc.content, this.user._id,
|
||||
pdoc.tag || [], pdoc.category || [], null, pdoc.hidden,
|
||||
);
|
||||
if (testdata) {
|
||||
const file = path.resolve(os.tmpdir(), 'hydro', `import_${domainId}_${pid || pdoc.pid || docId}.zip`);
|
||||
const w = fs.createWriteStream(file);
|
||||
|
||||
Reference in new issue
Block a user