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",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.3",
|
||||
"description": "本工具通过拓展小程序的wx.request,让开发者通过简单的配置,实现自动管理登录态等功能",
|
||||
"keywords": [
|
||||
"登录态",
|
||||
|
||||
@@ -206,7 +206,7 @@ async function code2Session(code: string) {
|
||||
},
|
||||
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)) {
|
||||
// 开启备份域名
|
||||
requestHandler.enableBackupDomain(obj.url);
|
||||
// 重试一次
|
||||
|
||||
Reference in New Issue
Block a user