租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
908 B

3 months ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getAsyncFetch = void 0;
  4. const formatObjKey_1 = require("../utils/formatObjKey");
  5. /*
  6. * getAsyncFetch
  7. * @param {String} asyncFetch taskId
  8. * @param {Object} options
  9. */
  10. async function getAsyncFetch(taskId, options = {}) {
  11. options.subres = Object.assign({ asyncFetch: '' }, options.subres);
  12. options.headers = options.headers || {};
  13. const params = this._objectRequestParams('GET', '', options);
  14. params.headers['x-oss-task-id'] = taskId;
  15. params.successStatuses = [200];
  16. params.xmlResponse = true;
  17. const result = await this.request(params);
  18. const taskInfo = formatObjKey_1.formatObjKey(result.data.TaskInfo, 'firstLowerCase');
  19. return {
  20. res: result.res,
  21. status: result.status,
  22. state: result.data.State,
  23. taskInfo
  24. };
  25. }
  26. exports.getAsyncFetch = getAsyncFetch;