修改:处理偶发会话不存在的问题
continuous-integration/drone/push Build was killed
continuous-integration/drone/promote/prod Build is passing

This commit is contained in:
Linzm committed 2026-11-10 15:25:57 +08:00
1 parent 3b10685876
commit 789d4f106c
4 files changed
+97 -14

No files matched your search

+8 -1
View File
@@ -712,7 +712,14 @@ export const getUploadUrl = async (input: {
)
// 注意:若 Content-Type 不是 application/json,axios 会把 body 留成 string
const ticket = parseUploadUrlResult(response?.data)
const body = coerceResponseBody(response?.data)
const code = Number(body.code)
// 业务失败(如会话不存在)需抛出原文,避免被吞成「缺少 upload_id」
if (Number.isFinite(code) && code !== 1000 && code !== 0) {
throw new Error(textOf(body.message || body.msg) || '签发上传地址失败')
}
const ticket = parseUploadUrlResult(body)
if (!ticket.upload_id) {
throw new Error('签发上传地址失败:缺少 upload_id')