feat: 域名错误增加错误码
This commit is contained in:
File diff suppressed because one or more lines are too long
4
build/weRequest.min.js
vendored
4
build/weRequest.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "we-request",
|
"name": "we-request",
|
||||||
"version": "1.7.1",
|
"version": "1.7.2",
|
||||||
"description": "本工具通过拓展小程序的wx.request,让开发者通过简单的配置,实现自动管理登录态等功能",
|
"description": "本工具通过拓展小程序的wx.request,让开发者通过简单的配置,实现自动管理登录态等功能",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"登录态",
|
"登录态",
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ function doRequest(obj: IRequestOption) {
|
|||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
// 如果主域名不可用,且配置了备份域名,且本次请求未使用备份域名
|
// 如果主域名不可用,且配置了备份域名,且本次请求未使用备份域名
|
||||||
if (res?.errMsg?.indexOf('CONNECTION_REFUSED') >= 0 && url.isInBackupDomainList(obj.url)) {
|
if ((res?.errMsg?.indexOf('CONNECTION_REFUSED') >= 0 || res?.errMsg?.indexOf('ERR_CONNECTION_RESET') >= 0) && url.isInBackupDomainList(obj.url)) {
|
||||||
// 开启备份域名
|
// 开启备份域名
|
||||||
enableBackupDomain(obj.url);
|
enableBackupDomain(obj.url);
|
||||||
// 重试一次
|
// 重试一次
|
||||||
@@ -192,7 +192,7 @@ function doUploadFile(obj: IUploadFileOption) {
|
|||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
// 如果主域名不可用,且配置了备份域名,且本次请求未使用备份域名
|
// 如果主域名不可用,且配置了备份域名,且本次请求未使用备份域名
|
||||||
if (res?.errMsg?.indexOf('CONNECTION_REFUSED') >= 0 && url.isInBackupDomainList(obj.url)) {
|
if ((res?.errMsg?.indexOf('CONNECTION_REFUSED') >= 0 || res?.errMsg?.indexOf('ERR_CONNECTION_RESET') >= 0) && url.isInBackupDomainList(obj.url)) {
|
||||||
// 开启备份域名
|
// 开启备份域名
|
||||||
enableBackupDomain(obj.url);
|
enableBackupDomain(obj.url);
|
||||||
// 重试一次
|
// 重试一次
|
||||||
|
|||||||
Reference in New Issue
Block a user