feat: Brief附件/项目平台/规则AI解析/消息中心修复 + 项目创建通知
- Brief 支持代理商附件上传 (迁移 007) - 项目新增 platform 字段 (迁移 008),前端创建/展示平台信息 - 修复 AI 规则解析:处理中文引号导致 JSON 解析失败的问题 - 修复消息中心崩溃:补全后端消息类型映射 + fallback 保护 - 项目创建时自动发送消息通知 - .gitignore 排除 backend/data/ 数据库文件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
58aed5f201
commit
4c9b2f1263
+20
-1
@@ -453,6 +453,23 @@ class ApiClient {
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端代理上传(绕过浏览器直传 TOS 的 CORS/代理问题)
|
||||
*/
|
||||
async proxyUpload(file: File, fileType: string = 'general', onProgress?: (pct: number) => void): Promise<FileUploadedResponse> {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('file_type', fileType)
|
||||
const response = await this.client.post<FileUploadedResponse>('/upload/proxy', formData, {
|
||||
timeout: 300000,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
onUploadProgress: (e) => {
|
||||
if (e.total && onProgress) onProgress(Math.round((e.loaded / e.total) * 100))
|
||||
},
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取私有桶文件的预签名访问 URL
|
||||
*/
|
||||
@@ -877,7 +894,9 @@ class ApiClient {
|
||||
* 上传文档并 AI 解析平台规则
|
||||
*/
|
||||
async parsePlatformRule(data: PlatformRuleParseRequest): Promise<PlatformRuleParseResponse> {
|
||||
const response = await this.client.post<PlatformRuleParseResponse>('/rules/platform-rules/parse', data)
|
||||
const response = await this.client.post<PlatformRuleParseResponse>('/rules/platform-rules/parse', data, {
|
||||
timeout: 180000, // 3 分钟,视觉模型解析图片 PDF 较慢
|
||||
})
|
||||
return response.data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user