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
d04628148f
commit
3c5fdb9032
16 files changed
+120
-118
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user