refactor: 重构知识库文件上传和处理, 支持 pdf
This commit is contained in:
@@ -34,21 +34,15 @@ class ViewDocument extends ViewRecord
|
||||
->modalSubmitActionLabel('确认重试')
|
||||
->action(function () {
|
||||
try {
|
||||
// 重置转换状态
|
||||
$this->record->conversion_status = 'pending';
|
||||
$this->record->conversion_error = null;
|
||||
$this->record->save();
|
||||
|
||||
// 重新派发转换任务
|
||||
\App\Jobs\ConvertDocumentToMarkdown::dispatch($this->record);
|
||||
|
||||
app(\App\Services\DocumentConversionService::class)
|
||||
->queueConversion($this->record);
|
||||
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('重试成功')
|
||||
->body('文档转换任务已重新加入队列,请稍后查看转换结果。')
|
||||
->send();
|
||||
|
||||
// 刷新页面数据
|
||||
|
||||
$this->refreshFormData([
|
||||
'conversion_status',
|
||||
'conversion_error',
|
||||
|
||||
Reference in New Issue
Block a user