dingtalk-jsapi
Version:
钉钉 模块化 多端统一 API
1 lines • 2.51 kB
JavaScript
function retry(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,i,o,s,a,u,c,f,l,h;return __generator(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4,t()];case 1:return[2,p.sent()];case 2:return r=p.sent(),n=e.method,i=e.isAuthApi,o=e.apiConfig,s=this.hadConfig&&void 0===this.isReady&&-1!==this.configJsApiList.indexOf(n),a="object"==typeof r&&"string"==typeof r.errorCode&&r.errorCode===sdkLib_1.ERROR_CODE.no_permission,u="object"==typeof r&&"string"==typeof r.errorCode&&r.errorCode===sdkLib_1.ERROR_CODE.cancel,c=__1.getTargetApiConfigVS(o,this.env),f=c&&this.env.version&&sdkLib_1.compareVersion(this.env.version,c),l=(this.env.platform===sdkLib_1.ENV_ENUM.ios||this.env.platform===sdkLib_1.ENV_ENUM.android)&&s&&a,h=this.env.platform===sdkLib_1.ENV_ENUM.pc&&s&&(f&&!u&&i||a),l||h?[2,this.config$.then(function(){return t()})]:[2,Promise.reject(r)];case 3:return[2]}})})}var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(s,a)}u((n=n.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=2&r[0]?o.return:r[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(exports,"__esModule",{value:!0}),exports.retry=void 0;var __1=require(".."),sdkLib_1=require("../sdkLib");exports.retry=retry;
;