自动查重

This commit is contained in:
wangjinlei
2026-05-20 14:46:58 +08:00
parent cfa3f791f4
commit 4940db73fe
5 changed files with 290 additions and 88 deletions

View File

@@ -395,9 +395,14 @@ class PlagiarismService
$resp = $tii->getViewerUrl($submissionId);
$url = '';
if (isset($resp['viewer_url'])) {
$url = (string)$resp['viewer_url'];
$url = (string) $resp['viewer_url'];
} elseif (isset($resp['url'])) {
$url = (string)$resp['url'];
$url = (string) $resp['url'];
} elseif (isset($resp['launch_url'])) {
$url = (string) $resp['launch_url'];
}
if ($url === '') {
throw new Exception('viewer-url response has no url: ' . json_encode($resp, JSON_UNESCAPED_UNICODE));
}
// 默认 2 小时过期,保守起见
return ['url' => $url, 'expire' => time() + 7200];