知识库文件删除修复
This commit is contained in:
@@ -235,10 +235,10 @@ public class KnowledgeController {
|
||||
* @since 2025-12-18
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('ai:knowledge:file:delete')")
|
||||
@DeleteMapping("/file/{fileId}")
|
||||
public ResultDomain<Boolean> deleteFile(@PathVariable("fileId") @NotBlank String fileId) {
|
||||
logger.info("删除知识库文件: fileId={}", fileId);
|
||||
return knowledgeService.deleteKnowledgeFileById(fileId);
|
||||
@DeleteMapping("/file/{fileRootId}")
|
||||
public ResultDomain<Boolean> deleteFile(@PathVariable("fileRootId") @NotBlank String fileRootId) {
|
||||
logger.info("删除知识库文件: fileId={}", fileRootId);
|
||||
return knowledgeService.deleteKnowledgeFileById(fileRootId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -162,8 +162,8 @@ export const aiKnowledgeAPI = {
|
||||
* 删除知识库文件
|
||||
* @param fileId 文件ID
|
||||
*/
|
||||
async deleteFile(fileId: string): Promise<ResultDomain<boolean>> {
|
||||
const response = await api.delete<boolean>(`${this.baseUrl}/file/${fileId}`)
|
||||
async deleteFile(fileRootId: string): Promise<ResultDomain<boolean>> {
|
||||
const response = await api.delete<boolean>(`${this.baseUrl}/file/${fileRootId}`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ const deleteFile = async (row: DocumentItem) => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
const result = await aiKnowledgeAPI.deleteFile(row.id)
|
||||
const result = await aiKnowledgeAPI.deleteFile(row.fileRootId)
|
||||
if (result.success) {
|
||||
ElMessage.success('删除成功')
|
||||
fetchDocuments(activeKnowledgeId.value)
|
||||
|
||||
Reference in New Issue
Block a user