自动查重
This commit is contained in:
@@ -197,16 +197,30 @@ class Plagiarism extends Base
|
||||
if ($needRefresh) {
|
||||
$svc = new PlagiarismService();
|
||||
$info = $svc->refreshViewerUrlFor($checkId);
|
||||
if ($info['url'] === '') {
|
||||
return jsonError('Turnitin returned empty viewer_url');
|
||||
}
|
||||
return jsonSuccess([
|
||||
'view_only_url' => $info['url'],
|
||||
'expire' => $info['expire'],
|
||||
'has_pdf' => !empty($info['local_pdf']),
|
||||
]);
|
||||
}
|
||||
return jsonSuccess([
|
||||
'view_only_url' => $row['view_only_url'],
|
||||
'expire' => intval($row['view_only_url_expire']),
|
||||
'has_pdf' => !empty($row['pdf_local_path']),
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
if (!empty($row['pdf_local_path'])) {
|
||||
return jsonSuccess([
|
||||
'view_only_url' => '',
|
||||
'expire' => 0,
|
||||
'has_pdf' => true,
|
||||
'viewer_error' => $e->getMessage(),
|
||||
'hint' => '在线报告暂不可用,请使用 downloadReport 下载 PDF',
|
||||
]);
|
||||
}
|
||||
return jsonError($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user