We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ce723e commit e1129e3Copy full SHA for e1129e3
1 file changed
src/push-uniapp.js
@@ -394,8 +394,14 @@ Connection.prototype.waitReconnect = function () {
394
this.reconnectInterval = this.reconnectInterval * 2;
395
}
396
// 有网络的状态下,重连间隔最大2秒
397
- if (this.reconnectInterval > 2000 && navigator.onLine) {
398
- _this.reconnectInterval = 2000;
+ if (this.reconnectInterval > 2000) {
+ uni.getNetworkType({
399
+ success: function (res) {
400
+ if (res.networkType != 'none') {
401
+ _this.reconnectInterval = 1000;
402
+ }
403
404
+ });
405
406
407
0 commit comments