diff --git a/src/api/controllers/core.ts b/src/api/controllers/core.ts index 8a69c8a..59795e9 100644 --- a/src/api/controllers/core.ts +++ b/src/api/controllers/core.ts @@ -171,7 +171,10 @@ export async function request( }, timeout: 15000, validateStatus: () => true, - ..._.omit(options, "params", "headers"), + ..._.omit(options, "params", "headers", "maxContentLength", "maxBodyLength"), + // 强制设置为Infinity,解决-1错误,放在最后确保不被覆盖 + maxContentLength: Infinity, + maxBodyLength: Infinity, }); // 流式响应直接返回response if (options.responseType == "stream") return response; @@ -187,6 +190,8 @@ export async function checkFileUrl(fileUrl: string) { if (util.isBASE64Data(fileUrl)) return; const result = await axios.head(fileUrl, { timeout: 15000, + maxContentLength: Infinity, + maxBodyLength: Infinity, validateStatus: () => true, }); if (result.status >= 400)