请求载荷大小限制提高到100mb,增加新的异常信息

This commit is contained in:
Vinlic 2024-03-15 18:34:55 +08:00
parent fc5c13b650
commit 25606dc1ea
3 changed files with 9 additions and 6 deletions

View File

@ -4,5 +4,6 @@ export default {
API_REQUEST_FAILED: [-2001, '请求失败'],
API_TOKEN_EXPIRES: [-2002, 'Token已失效'],
API_FILE_URL_INVALID: [-2003, '远程文件URL非法'],
API_FILE_EXECEEDS_SIZE: [-2004, '远程文件超出大小']
API_FILE_EXECEEDS_SIZE: [-2004, '远程文件超出大小'],
API_CHAT_STREAM_PUSHING: [-2005, '已有对话流正在输出']
}

View File

@ -461,6 +461,8 @@ function checkResult(result: AxiosResponse, refreshToken: string) {
return result.data;
if (error_type == 'auth.token.invalid')
accessTokenMap.delete(refreshToken);
if (error_type == 'chat.user_stream_pushing')
throw new APIException(EX.API_CHAT_STREAM_PUSHING);
throw new APIException(EX.API_REQUEST_FAILED, `[请求kimi失败]: ${message}`);
}

View File

@ -44,12 +44,12 @@ export class SystemConfig {
this.requestBody = Object.assign(requestBody || {}, {
enableTypes: ['json', 'form', 'text', 'xml'],
encoding: 'utf-8',
formLimit: '10mb',
jsonLimit: '10mb',
textLimit: '10mb',
xmlLimit: '10mb',
formLimit: '100mb',
jsonLimit: '100mb',
textLimit: '100mb',
xmlLimit: '100mb',
formidable: {
maxFileSize: '30mb'
maxFileSize: '100mb'
},
multipart: true,
parsedMethods: ['POST', 'PUT', 'PATCH']