docs: function sliceUpload(opt) {
  
          var that = this;
          var file = opt.file;
          var defer = $.Deferred();
  
          // 整理参数
          var progressTimer;
          var task = {
              opt: opt,
              uploadingAjax: [],
              uploadingCount: 0,
              currentIndex: 0,
              chunkCount: Math.ceil(file.size / opt.slice_size),
              chunks: [],
              loadedSize: 0,
              uploadError: false,
              onTaskProgress: function (immediately) {
                  var progress = function () {
                      progressTimer = 0;
                      opt.onprogress && opt.onprogress(task.loadedSize / file.size, 1);
                  };
                  if (immediately) {
                      clearTimeout(progressTimer);
                      progress();
                  } else {
                      if (progressTimer) return;
                      progressTimer = setTimeout(progress, 100);
                  }
              }
          };
  
          // 整理所有分片数据
          (function (){
              var i, partMap = {};
              if (opt.listparts) {
                  for (i = 0; i < opt.listparts.length; i++) {
                      partMap[opt.listparts[i].offset] = opt.listparts[i];
                  }
              }
              for (i = 0; i < task.chunkCount; i++) {
                  var start = i * opt.slice_size;
                  var end = Math.min(start + opt.slice_size, file.size);
                  var chunk = {
                      start: start,
                      end: end,
                      size: end - start
                  };
                  if (partMap[start]) {
                      task.loadedSize += chunk.size;
                      chunk.state = 'online';
                  } else {
                      chunk.state = 'waiting';
                  }
                  task.chunks.push(chunk);
              }
          })();
  
          // 所有分片上传完成，发起回调
          var uploadSuccess = function () {
              task.onTaskProgress(true);
              defer.resolve();
          };
  
          // 出错的时候，结束所有上传，发起回调
          var uploadError = function (error, res) {
              task.uploadError = 'error';
              for (var i = task.uploadingAjax.length - 1; i >= 0; i--) {
                  var ajax = task.uploadingAjax[i];
                  ajax && ajax.abort();
              }
              task.onTaskProgress(true);
              defer.reject(res);
          };
  
          opt.globalTask.cancelRequests = function () {
              for (var i = task.uploadingAjax.length - 1; i >= 0; i--) {
                  var ajax = task.uploadingAjax[i];
                  ajax && ajax.abort();
              }
          };
  
          // 开始上传并发上传，同一个上传实例里共用线程数限制
          var uploadNextChunk = function () {
              if (opt.globalTask.state === 'cancel') return;
              for (; that._uploadingThreadCount < that.uploadMaxThread && task.currentIndex < task.chunkCount; task.currentIndex++) {
                  var chunk = task.chunks[task.currentIndex];
                  if (chunk.state !== 'waiting') continue;
                  (function (chunk) {
                      chunk.state = 'uploading';
                      task.uploadingCount++;
                      that._uploadingThreadCount++;
                      uploadSingleChunk.call(that, task, chunk, function (error, data) {
                          task.uploadingCount--;
                          that._uploadingThreadCount--;
                          if (error) { // 错误马上结束
                              chunk.state = 'error';
                              uploadError(error, data);
                          } else {
                              chunk.state = 'success';
                              if (task.uploadingCount <= 0 && task.currentIndex >= task.chunkCount) { // 全部完成
                                  uploadSuccess();
                              } else { // 未完成，处理执行下一个分片
                                  uploadNextChunk();
                              }
                          }
                      });
                  })(chunk);
              }
              if (task.uploadingCount === 0 && task.currentIndex === task.chunks.length) { // 全部不需要上传
                  uploadSuccess();
              }
          };
          uploadNextChunk();
  
          return defer.promise();
      }