优化
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user