Skip to content

Commit e1129e3

Browse files
authored
Update push-uniapp.js
1 parent 9ce723e commit e1129e3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/push-uniapp.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,14 @@ Connection.prototype.waitReconnect = function () {
394394
this.reconnectInterval = this.reconnectInterval * 2;
395395
}
396396
// 有网络的状态下,重连间隔最大2秒
397-
if (this.reconnectInterval > 2000 && navigator.onLine) {
398-
_this.reconnectInterval = 2000;
397+
if (this.reconnectInterval > 2000) {
398+
uni.getNetworkType({
399+
success: function (res) {
400+
if (res.networkType != 'none') {
401+
_this.reconnectInterval = 1000;
402+
}
403+
}
404+
});
399405
}
400406
}
401407
}

0 commit comments

Comments
 (0)