code: function startUploadStateCheck(timeout, cb) {
      var checkTimer = null;
  
      /**
       * 每10ms检测一次uploading状态，当前没有上传任务时，uploading为0
       * @return {[type]} [description]
       */
      function checkUplodingStatus() {
          checkTimer = setInterval(function () {
              if (uploading === 0 && checkTimer) {
                  clearInterval(checkTimer);
                  checkTimer = null;
                  // 检测通过，开始检测50ms内是否还有新请求
                  waitforNewUpload();
              }
          }, 10);
      }
  
      /**
       * 判断20ms内是否还有新增的上传请求，如果有则回到uploding检测状态
       * @return {[type]} [description]
       */
      function waitforNewUpload() {
          var periodTotal = total;
          setTimeout(function () {
              if (periodTotal === total) {
                  debuglog('detect upload end');
                  end();
              }
              else {
                  debuglog('restart upload detect', periodTotal, total);
                  checkUplodingStatus(cb);
              }
          }, 50);
      }
  
      function end() {
          globalCheckSatus = false;
          clearTimeout(uploadTimeout);
          uploadTimeout = null;
          clearInterval(checkTimer);
          checkTimer = null;
          total = 0;
          cb && cb();
      }
  
      if (globalCheckSatus) {
          return;
      }
  
      globalCheckSatus = true;
  
      checkUplodingStatus();
  
      // 上传整体超时检测
      var uploadTimeout = setTimeout(function () {
          debuglog('upload timeout');
          end();
      }, timeout * 1000);
  }
docs: 检测上传是否结束
  @param  {[type]}   timeout [description]
  @param  {Function} cb      [description]
  @return {[type]}           [description]