Taro.request请求进不到success,fail里是怎么回事?



  • 03e6c6dd-4b7e-45a7-89f9-5315714249ab-image.png
    5991f86c-2dd7-4976-8514-2b817a939828-image.png



  • var _loop = function _loop() {
          var options = _this.queue.shift();
    
          var successFn = options.successFn,
              failFn = options.failFn;
    
          options.success = function () {
            _this.pendingQueue = _this.pendingQueue.filter(function (item) {
              return item !== options;
            });
    
            _this.run();
    
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
    
            successFn && successFn.apply(options, args);
          };
    
          options.fail = function () {
            _this.pendingQueue = _this.pendingQueue.filter(function (item) {
              return item !== options;
            });
    
            _this.run();
    
            for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
              args[_key2] = arguments[_key2];
            }
    
            failFn && failFn.apply(options, args);
          };
    
          _this.pendingQueue.push(options);
    
          return {
            v: wx.request(options)
          };
        };
    

    成功回调取的是options里的successFn,不是success,很迷



  • 更新下依赖包就好了,新版本修复了这个bug


登录后回复