This commit is contained in:
2026-09-20 14:43:33 +08:00
parent 3ba8809222
commit 4dc8899086
2 changed files with 17 additions and 1 deletions
+3 -1
View File
@@ -174,7 +174,9 @@ export async function overseasDownload(path, options = {}) {
throw errorFrom({ ...response, data: {} }, '签收照片下载失败')
}
const contentType = String(response?.header?.['content-type'] || response?.header?.['Content-Type'] || '').toLowerCase()
if (expectedContentTypePrefix && !contentType.startsWith(expectedContentTypePrefix.toLowerCase())) {
// App-Plus downloadFile may omit response headers even when the image body was downloaded successfully.
// Reject an explicit non-image response, but allow a valid temp file when Content-Type is unavailable.
if (expectedContentTypePrefix && contentType && !contentType.startsWith(expectedContentTypePrefix.toLowerCase())) {
throw errorFrom({ ...response, data: {} }, '照片服务返回了无效内容,请稍后重试')
}
return response.tempFilePath