国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman/push push-uniapp.js BUG

qiling

問(wèn)題描述

這里寫描述
push-uniapp.js 斷線后 代碼監(jiān)聽事件疊加
打包安卓后 navigator.onLine 報(bào)錯(cuò)

解決方式

push-uniapp.js 斷線后 代碼監(jiān)聽事件疊加

function Connection(options) {
    this.dispatcher = new Dispatcher();
    __extends(this, this.dispatcher);
    var properies = ['on', 'off', 'emit'];
    for (var i in properies) {
        this[properies[i]] = this.dispatcher[properies[i]];
    }
    this.options = options;
    this.state = 'initialized'; //initialized connecting connected disconnected
    this.doNotConnect = 0;
    this.reconnectInterval = 1;
    this.connection = null;
    this.reconnectTimer = 0;
    //增加已經(jīng)創(chuàng)建過(guò)的標(biāo)記
    this.isConnection = false;
    this.connect();
}

//非首次連接不設(shè)置回調(diào) uniapp 只需要首次 注冊(cè)事件 否則會(huì)疊加回調(diào)事件
if(!_this.isConnection){
    _this.isConnection = true;
    cb();
}

打包安卓后 navigator.onLine 報(bào)錯(cuò)

// 有網(wǎng)絡(luò)的狀態(tài)下,重連間隔最大2秒 這里安卓有bug 做兼容處理
// #ifdef H5
    if (this.reconnectInterval > 2000 && navigator.onLine) {
        _this.reconnectInterval = 2000;
    }
// #endif
// #ifdef APP-PLUS
    if (this.reconnectInterval > 2000) {
        _this.reconnectInterval = 2000;
    }
// #endif
889 1 0
1個(gè)回答

walkor 打賞

發(fā)個(gè)pr吧

  • 鄒意 2024-06-07

    這玩意是不是我前兩天研究的問(wèn)題哦,還沒來(lái)得及研究前端

年代過(guò)于久遠(yuǎn),無(wú)法發(fā)表回答
??