移除可以与同一用户创建多个会话的特性

This commit is contained in:
masnn committed 2020-05-15 13:10:41 +08:00
1 parent d04628148f
commit 3c5fdb9032
16 files changed
+120 -118

No files matched your search

+2 -2
View File
@@ -22,10 +22,10 @@ class ProblemImportHandler extends Handler {
async post({
url, pid, hidden, remoteType,
}) {
if (typeof this[`from_${remoteType}`] !== 'function') {
if (typeof global.Hydro.lib[`import.${remoteType}`] !== 'function') {
throw new ValidationError('remoteType');
}
const [pdoc, testdata] = await this[`from_${remoteType}`](url);
const [pdoc, testdata] = await global.Hydro.lib[`import.${remoteType}`](url, this);
if (pid) pdoc.pid = pid;
if (hidden) pdoc.hidden = true;
const _id = await problem.add(pdoc);