AI 对话web、wx优化

This commit is contained in:
2025-12-29 12:49:23 +08:00
parent 02aed37287
commit 6a2544e964
11 changed files with 960 additions and 139 deletions

View File

@@ -119,7 +119,7 @@ export const aiChatAPI = {
const formData = new FormData()
formData.append('file', file)
formData.append('agentId', agentId)
const response = await api.uploadPut<DifyFileInfo>(`${this.baseUrl}/file/upload`, formData)
const response = await api.upload<DifyFileInfo>(`${this.baseUrl}/file/upload`, formData)
return response.data
}
}

View File

@@ -13,27 +13,27 @@ export interface DifyFileInfo {
/** 文件扩展名 */
extension?: string
/** 文件MIME类型 */
mimeType?: string
mime_type?: string
/** 上传人ID */
createdBy?: string
created_by?: string
/** 上传时间(时间戳) */
createdAt?: number
created_at?: number
/** 预览URL */
previewUrl?: string
preview_url?: string
/** 源文件URL */
sourceUrl?: string
source_url?: string
/** 文件类型image、document、audio、video、file */
type?: string
/** 传输方式remote_url、local_file */
transferMethod?: string
transfer_method?: string
/** 文件URL或ID */
url?: string
/** 本地文件上传ID */
uploadFileId?: string
upload_file_id?: string
/** 系统文件ID */
sysFileId?: string
sys_file_id?: string
/** 文件路径(从系统文件表获取) */
filePath?: string
file_path?: string
}
/**