| | |
| | | : config.data, |
| | | time: new Date().getTime(), |
| | | }; |
| | | const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小 |
| | | const requestSize = new TextEncoder().encode(JSON.stringify(requestObj)).byteLength; // 请求数据大小 |
| | | const limitSize = 5 * 1024 * 1024; // 限制存放数据5M |
| | | if (requestSize >= limitSize) { |
| | | console.warn( |
| | |
| | | // 未设置状态码则默认成功状态 |
| | | const code = res.data.code || 200; |
| | | // 获取错误信息 |
| | | const msg = errorCode[code] || res.data.msg || errorCode["default"]; |
| | | const msg = res.data.message || res.data.msg || errorCode[code] || errorCode["default"]; |
| | | // 二进制数据则直接返回 |
| | | if ( |
| | | res.request.responseType === "blob" || |