Skip to content

Commit

Permalink
Update push-uniapp.js
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Jun 26, 2024
1 parent 9ce723e commit e1129e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/push-uniapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,14 @@ Connection.prototype.waitReconnect = function () {
this.reconnectInterval = this.reconnectInterval * 2;
}
// 有网络的状态下,重连间隔最大2秒
if (this.reconnectInterval > 2000 && navigator.onLine) {
_this.reconnectInterval = 2000;
if (this.reconnectInterval > 2000) {
uni.getNetworkType({
success: function (res) {
if (res.networkType != 'none') {
_this.reconnectInterval = 1000;
}
}
});
}
}
}
Expand Down

0 comments on commit e1129e3

Please sign in to comment.