applets-request-mode-list
Advanced tools
Comparing version
@@ -253,2 +253,8 @@ import appletsRequest, { getDefaults } from 'applets-request-all'; | ||
}; | ||
ApiHttp.prototype.isRetryError = function (err) { | ||
if (!err) { | ||
return false; | ||
} | ||
return err.errCode === "RETRY_ERROR"; | ||
}; | ||
return ApiHttp; | ||
@@ -255,0 +261,0 @@ }()); |
@@ -29,3 +29,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apiHttp={})}(this,(function(t){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var i=function(){function t(t){this.message="",this.isCancel=!0,this.message=t}return t.prototype.toString=function(){return"Cancel: "+(this.message||"")},t}(),a=function(){function t(t){var e=this;this.promise=new Promise((function(t){e.promiseResolve=t})),"function"==typeof t&&t(this.cancel.bind(this))}return t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},t.prototype.cancel=function(t){this.reason||(this.reason=new i(t),this.promiseResolve(this.reason))},t.prototype.subscribeCancelEvent=function(t){return this.promise.then(t)},t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t}();function s(t){return Object.prototype.toString.call(t)}function u(t){if(null===t||"[object Object]"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return void 0===t}function f(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function p(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){u(r[e])&&u(t)?r[e]=p(r[e],t):u(t)?r[e]=p({},t):Array.isArray(t)?r[e]=p(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){f(t,n)})),r}function l(t){return"string"==typeof t}function h(t){return"function"==typeof t}function d(t){return!c(t)&&(t&&t.isCancel)}function y(t){return t&&"string"==typeof t?t.toUpperCase():"GET"}var m=function(){function t(t){this.reqConfig=this.copyAdapterConfig(t)}return t.prototype.resolve=function(t,e){(c(t)||null===t)&&e({headers:{},status:200,data:{},config:this.reqConfig,originalRes:null}),e({headers:t.headers,config:this.reqConfig,data:t.data,status:t.status,originalRes:c(t.response)?null:t.response})},t.prototype.reject=function(t,e){(c(t)||null===t)&&e({headers:null,status:"NETWORK_ERROR",errMsg:"Reject arguments Error",data:null,config:this.reqConfig,response:null,extra:null}),e({status:t.status,errMsg:t.errMsg,config:this.reqConfig,headers:t.headers||{},data:t.data,response:c(t.response)?null:t.response,extra:c(t.extra)?null:t.extra})},t.prototype.subscribeCancelEvent=function(t){if(this.reqConfig.cancelToken)return this.reqConfig.cancelToken.subscribeCancelEvent(t)},t.prototype.copyAdapterConfig=function(t){if(c(t)||null===t)return{};var e=p({},t);return delete e.Adapter,e},t}();function v(t){var e=new m(r({method:y(t.method)},t));return new Promise((function(t){console.log("defaultAdapter: ","Pls set adapter!!! Don't use default adapter"),e.resolve({data:{},headers:{},status:404,response:null},t)}))}function g(t,e){e&&f(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}var b="miniRequest:cookies";function R(){var t;return{adapter:v,method:"GET",timeout:1e4,headers:r({common:{Accept:"application/json, text/plain, */*"}},(t={},["delete","get","head","options"].forEach((function(e){t[e]={}})),["post","put","patch"].forEach((function(e){t[e]={"Content-Type":"application/json; charset=utf-8"}})),t)),transformConfig:[],transformRequest:[function(t,e){return g(e,"Accept"),g(e,"Content-Type"),u(t)&&function(t,e){!c(t)&&t&&c(t["Content-Type"])&&(t["Content-Type"]=e)}(e,"application/json; charset=utf-8"),t}],transformResponse:[],xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",validateStatus:function(t){return t>=200&&t<300}}}function E(t){return!c(t)&&null!==t&&"NETWORK_ERROR"===t.status}function T(t){return!c(t)&&null!==t&&"TIMEOUT"===t.status}function j(t,e){var r=t||"",n=e||"";return n?r.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):r}function O(t){return/^([a-z][a-z\d+-.]*:)?\/\//i.test(t||"")}function C(t,e,r){var n=q(t);if("string"==typeof e)return w(n,e);var o,i=Object.keys(null===(o=e)||"object"!=typeof o?{}:e);if(0===i.length&&!h(r))return n;var a=h(r)?null==r?void 0:r(e):function(t,e){var r=t.filter((function(t){return function(t){if(null==t)return!1;return!0}(e[t])})).map((function(t){return function(t,e){if(Array.isArray(e))return function(t,e){var r=e.map((function(e,r){return 0===r?e:k(t+"[]")+"="+k(e)}));return[k(t+"[]"),r.join("&")]}(t,e);if(function(t){return"[object Date]"===s(t)}(e))return[k(t),k(e.toISOString())];if(u(e))return[k(t),k(JSON.stringify(e))];return[t,e]}(t,e[t])}));if(0===r.length)return"";return r.reduce((function(t,e){return e[0]&&e[1]?(t?t+"&":"")+e.join("="):t}),"")}(i,e);return a?w(n,a):n}function w(t,e){return t.includes("?")?t+"&"+e:t+"?"+e}function q(t){return t.includes("#")?t.slice(0,t.indexOf("#")):t}function k(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function A(t,e,r){return t?C(t,e,r):q(t)}function x(t){return!!c(t)||!!h(t)}var N=function(){function t(){this.interceptors=[]}return t.prototype.use=function(t,e){var r={fulfilled:x(t)?t:void 0,rejected:x(e)?e:void 0};return this.interceptors.push(r),this.interceptors.length-1},t.prototype.eject=function(t){this.interceptors[t]&&(this.interceptors[t]=null)},t.prototype.forEach=function(t){this.interceptors.forEach((function(e,r){"function"==typeof t&&null!==e&&t(e,r)}))},t.prototype.size=function(){return this.interceptors.length},t}();function S(t,e){var r=e||{},n=Object.create(null),o=["url","method","data"],i=["headers","params"],a=["validateStatus","writeCookies","readCookies"];function s(e){var o=t[e],i=r[e];c(i)?c(o)||(n[e]=l(void 0,o)):n[e]=l(o,i)}function l(t,e){return u(t)&&u(e)?p(t,e):u(e)?p({},e):h(e)}function h(t){return Array.isArray(t)||u(t)?p(t):t}o.forEach((function(t){var e=r[t];if(c(e))return;n[t]=h(e)})),["baseURL","transformConfig","transformRequest","transformResponse","paramsSerializer","timeout","adapter","responseType","xsrfCookieName","xsrfHeaderName","cancelToken"].forEach((function(e){var o=r[e];if(!c(o))return void(n[e]=h(o));c(t[e])||(n[e]=h(t[e]))})),a.forEach((function(e){if(e in r)return void(n[e]=h(r[e]));e in t&&(n[e]=h(t[e]))})),i.forEach(s);var d=o.concat(i).concat(a).concat(i);return f(Object.keys(t).concat(Object.keys(r)).filter((function(t){return!d.includes(t)})),s),n}function U(t,e){var r={};if(!u(t))return r;if(0===e.length)return t;var n={};return e.forEach((function(t){n[t.toUpperCase()]=t})),Object.keys(t).forEach((function(e){var o=e.toUpperCase(),i=n[o];r[i||e]=t[e]})),r}function P(t,e){if(!t)return{};var r=p(t.common,t[e.toLowerCase()],t);return["delete","get","post","head","patch","put","options","common"].forEach((function(t){delete r[t]})),r}function L(t,e){return e||"0"===String(e)?t+"="+e:t}function I(t,e){var r=t;return f(e,(function(t){"function"==typeof t&&(r=t(r))})),function(t){return t?Array.isArray(t)?p([],t):p({},t):{}}(r)}function M(t,e,r){var n=t;return f(r,(function(t){"function"==typeof t&&(n=t(n,e))})),n}function W(t){return t&&h(t.readCookies)?t.readCookies(b):{}}function _(t,e){if(!t||!e)return"";var r=t[e];return c(r)||null===r?"":t[e]}var z=decodeURIComponent,D=/; */;function K(t,e){return void 0===e&&(e={}),t?function(t,e){void 0===e&&(e={});if("string"!=typeof t)return{};var r={},n=t.split(D),o=e.decode||z;return n.forEach((function(t){var e=t.indexOf("=");if(!(e<0)){var n=t.substr(0,e).trim(),i=t.substr(e+1,t.length).trim();'"'===i[0]&&(i=i.slice(1,-1)),c(r[n])&&(r[n]=function(t,e){try{return e(t)}catch(e){return t}}(i,o))}})),r}(t,e):{}}var F=function(t,e,r,n,o){this.extra=null,this.errMsg=t,this.config=e,this.status=r,this.response=n,this.extra=o};function G(t,e,r,n,o){return new F(t,e,r||0===r?r:"NETWORK_ERROR",n,o)}function H(t){return n(this,void 0,void 0,(function(){var e,n,i,a;return o(this,(function(o){switch(o.label){case 0:e=function(t){V(t);var e=t.baseURL,n=t.url,o=t.params,i=A(O(n)?n:j(e,n),o,t.paramsSerializer),a=y(t.method),s=r(r({},t),{headers:P(t.headers,a)});s.data=M(s.data,s.headers,s.transformRequest),s.headers=(c=s.headers,f=s.data,p=U(Object.assign(c||{}),["Content-Type"]),u(f)&&!p["Content-Type"]&&(p["Content-Type"]="application/json; charset=utf-8"),null==f&&delete p["Content-Type"],p);var c,f,p;var h=function(t){return t.withCredentials,e=t.headers.Cookies,r=t.xsrfCookieName,n=_(W(t),t.xsrfCookieName),r||String(r)===String(0)?l(e)?e+"; "+L(r,n):n||"0"===String(n)?""+L(r,n):r:e;var e,r,n;return""}(s=I(s,t.transformConfig));h&&(s.headers.Cookies=h);var d=_(W(t),s.xsrfCookieName);d&&(s.headers[s.xsrfHeaderName]=d);return r(r({},s),{url:i,method:a,headers:s.headers,getRequestTask:X(s.getRequestTask),Adapter:m})}(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.adapter(e)];case 2:return n=o.sent(),V(e),u(n.headers)&&(n.cookies=K(U(n.headers,["Set-Cookie"])["Set-Cookie"])),function(t,e){t.autoCookies&&h(t.writeCookies)&&t.writeCookies(b,e)}(t,n.cookies),"function"==typeof t.validateStatus&&t.validateStatus(n.status)?(n.data=M(n.data,n.headers,e.transformResponse),[2,n]):[2,Promise.reject(G("Request failed with status code "+n.status,n.config,n.status,n))];case 3:return d(i=o.sent())?[2,Promise.reject(i)]:(V(e),(a=i)&&a.response&&(a.response.data=M(a.response.data,a.response.headers,e.transformResponse)),a instanceof TypeError?[2,Promise.reject(G(a.message,a.config,"SCRIPT_ERROR",a.response,a))]:[2,Promise.reject(G(a.errMsg,a.config,a.status,a.response,a.extra))]);case 4:return[2]}}))}))}function V(t){t.cancelToken&&t.cancelToken.throwIfRequested()}function X(t){return"function"==typeof t?t:function(){}}var J,Y=new(function(){function t(e){this.AppletsRequest=t,this.CancelToken=a,this.defaults={},this.isCancel=d,this.isTimeout=T,this.isNetworkError=E,e&&(this.defaults=e),this.interceptors={request:new N,response:new N}}return t.prototype.request=function(t,e){var r={};"string"==typeof t?(r=this.transformConfig(e)).url=t:r=t,r=S(this.defaults,r);var n=[{fulfilled:H,rejected:void 0}];this.interceptors.request.forEach((function(t){return n.unshift(t)})),this.interceptors.response.forEach((function(t){return n.push(t)}));var o=Promise.resolve(r);return n.forEach((function(t){t&&(o=o.then(t.fulfilled,t.rejected))})),o},t.prototype.get=function(t,e){return this.requestWithMethod(t,"GET",e)},t.prototype.delete=function(t,e){return this.requestWithMethod(t,"DELETE",e)},t.prototype.head=function(t,e){return this.requestWithMethod(t,"HEAD",e)},t.prototype.options=function(t,e){return this.requestWithMethod(t,"OPTIONS",e)},t.prototype.post=function(t,e,r){return this.requestWithData(t,"POST",e,r)},t.prototype.put=function(t,e,r){return this.requestWithData(t,"PUT",e,r)},t.prototype.create=function(e){var r=new t(S(R(),e));return function(t,e){if(l(e))return t;for(var r in e)t[r]=e[r];return t}(t.prototype.request.bind(r),r)},t.prototype.all=function(t){if(0===t.length)throw new TypeError("arguments length is 0");return Promise.all(t)},t.prototype.getUri=function(t){var e=t.url,r=t.baseURL,n=t.params,o=e||"";return A(O(o)?o:j(r||"",o),n,t.paramsSerializer)},t.prototype.requestWithMethod=function(t,e,n){return this.request(r(r({},this.transformConfig(n)),{url:t,method:e}))},t.prototype.requestWithData=function(t,e,n,o){return this.requestWithMethod(t,e,r(r({},this.transformConfig(o)),{data:n}))},t.prototype.transformConfig=function(t){return u(t)?t:{}},t}())(J).create(J),$=function(){return($=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}; | ||
***************************************************************************** */function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var i=function(){function t(t){this.message="",this.isCancel=!0,this.message=t}return t.prototype.toString=function(){return"Cancel: "+(this.message||"")},t}(),a=function(){function t(t){var e=this;this.promise=new Promise((function(t){e.promiseResolve=t})),"function"==typeof t&&t(this.cancel.bind(this))}return t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},t.prototype.cancel=function(t){this.reason||(this.reason=new i(t),this.promiseResolve(this.reason))},t.prototype.subscribeCancelEvent=function(t){return this.promise.then(t)},t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t}();function s(t){return Object.prototype.toString.call(t)}function u(t){if(null===t||"[object Object]"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return void 0===t}function f(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function p(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){u(r[e])&&u(t)?r[e]=p(r[e],t):u(t)?r[e]=p({},t):Array.isArray(t)?r[e]=p(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){f(t,n)})),r}function l(t){return"string"==typeof t}function h(t){return"function"==typeof t}function d(t){return!c(t)&&(t&&t.isCancel)}function y(t){return t&&"string"==typeof t?t.toUpperCase():"GET"}var m=function(){function t(t){this.reqConfig=this.copyAdapterConfig(t)}return t.prototype.resolve=function(t,e){(c(t)||null===t)&&e({headers:{},status:200,data:{},config:this.reqConfig,originalRes:null}),e({headers:t.headers,config:this.reqConfig,data:t.data,status:t.status,originalRes:c(t.response)?null:t.response})},t.prototype.reject=function(t,e){(c(t)||null===t)&&e({headers:null,status:"NETWORK_ERROR",errMsg:"Reject arguments Error",data:null,config:this.reqConfig,response:null,extra:null}),e({status:t.status,errMsg:t.errMsg,config:this.reqConfig,headers:t.headers||{},data:t.data,response:c(t.response)?null:t.response,extra:c(t.extra)?null:t.extra})},t.prototype.subscribeCancelEvent=function(t){if(this.reqConfig.cancelToken)return this.reqConfig.cancelToken.subscribeCancelEvent(t)},t.prototype.copyAdapterConfig=function(t){if(c(t)||null===t)return{};var e=p({},t);return delete e.Adapter,e},t}();function v(t){var e=new m(r({method:y(t.method)},t));return new Promise((function(t){console.log("defaultAdapter: ","Pls set adapter!!! Don't use default adapter"),e.resolve({data:{},headers:{},status:404,response:null},t)}))}function g(t,e){e&&f(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}var R="miniRequest:cookies";function b(){var t;return{adapter:v,method:"GET",timeout:1e4,headers:r({common:{Accept:"application/json, text/plain, */*"}},(t={},["delete","get","head","options"].forEach((function(e){t[e]={}})),["post","put","patch"].forEach((function(e){t[e]={"Content-Type":"application/json; charset=utf-8"}})),t)),transformConfig:[],transformRequest:[function(t,e){return g(e,"Accept"),g(e,"Content-Type"),u(t)&&function(t,e){!c(t)&&t&&c(t["Content-Type"])&&(t["Content-Type"]=e)}(e,"application/json; charset=utf-8"),t}],transformResponse:[],xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",validateStatus:function(t){return t>=200&&t<300}}}function E(t){return!c(t)&&null!==t&&"NETWORK_ERROR"===t.status}function T(t){return!c(t)&&null!==t&&"TIMEOUT"===t.status}function O(t,e){var r=t||"",n=e||"";return n?r.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):r}function j(t){return/^([a-z][a-z\d+-.]*:)?\/\//i.test(t||"")}function C(t,e,r){var n=q(t);if("string"==typeof e)return w(n,e);var o,i=Object.keys(null===(o=e)||"object"!=typeof o?{}:e);if(0===i.length&&!h(r))return n;var a=h(r)?null==r?void 0:r(e):function(t,e){var r=t.filter((function(t){return function(t){if(null==t)return!1;return!0}(e[t])})).map((function(t){return function(t,e){if(Array.isArray(e))return function(t,e){var r=e.map((function(e,r){return 0===r?e:k(t+"[]")+"="+k(e)}));return[k(t+"[]"),r.join("&")]}(t,e);if(function(t){return"[object Date]"===s(t)}(e))return[k(t),k(e.toISOString())];if(u(e))return[k(t),k(JSON.stringify(e))];return[t,e]}(t,e[t])}));if(0===r.length)return"";return r.reduce((function(t,e){return e[0]&&e[1]?(t?t+"&":"")+e.join("="):t}),"")}(i,e);return a?w(n,a):n}function w(t,e){return t.includes("?")?t+"&"+e:t+"?"+e}function q(t){return t.includes("#")?t.slice(0,t.indexOf("#")):t}function k(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function A(t,e,r){return t?C(t,e,r):q(t)}function x(t){return!!c(t)||!!h(t)}var N=function(){function t(){this.interceptors=[]}return t.prototype.use=function(t,e){var r={fulfilled:x(t)?t:void 0,rejected:x(e)?e:void 0};return this.interceptors.push(r),this.interceptors.length-1},t.prototype.eject=function(t){this.interceptors[t]&&(this.interceptors[t]=null)},t.prototype.forEach=function(t){this.interceptors.forEach((function(e,r){"function"==typeof t&&null!==e&&t(e,r)}))},t.prototype.size=function(){return this.interceptors.length},t}();function S(t,e){var r=e||{},n=Object.create(null),o=["url","method","data"],i=["headers","params"],a=["validateStatus","writeCookies","readCookies"];function s(e){var o=t[e],i=r[e];c(i)?c(o)||(n[e]=l(void 0,o)):n[e]=l(o,i)}function l(t,e){return u(t)&&u(e)?p(t,e):u(e)?p({},e):h(e)}function h(t){return Array.isArray(t)||u(t)?p(t):t}o.forEach((function(t){var e=r[t];if(c(e))return;n[t]=h(e)})),["baseURL","transformConfig","transformRequest","transformResponse","paramsSerializer","timeout","adapter","responseType","xsrfCookieName","xsrfHeaderName","cancelToken"].forEach((function(e){var o=r[e];if(!c(o))return void(n[e]=h(o));c(t[e])||(n[e]=h(t[e]))})),a.forEach((function(e){if(e in r)return void(n[e]=h(r[e]));e in t&&(n[e]=h(t[e]))})),i.forEach(s);var d=o.concat(i).concat(a).concat(i);return f(Object.keys(t).concat(Object.keys(r)).filter((function(t){return!d.includes(t)})),s),n}function U(t,e){var r={};if(!u(t))return r;if(0===e.length)return t;var n={};return e.forEach((function(t){n[t.toUpperCase()]=t})),Object.keys(t).forEach((function(e){var o=e.toUpperCase(),i=n[o];r[i||e]=t[e]})),r}function P(t,e){if(!t)return{};var r=p(t.common,t[e.toLowerCase()],t);return["delete","get","post","head","patch","put","options","common"].forEach((function(t){delete r[t]})),r}function L(t,e){return e||"0"===String(e)?t+"="+e:t}function I(t,e){var r=t;return f(e,(function(t){"function"==typeof t&&(r=t(r))})),function(t){return t?Array.isArray(t)?p([],t):p({},t):{}}(r)}function M(t,e,r){var n=t;return f(r,(function(t){"function"==typeof t&&(n=t(n,e))})),n}function W(t){return t&&h(t.readCookies)?t.readCookies(R):{}}function _(t,e){if(!t||!e)return"";var r=t[e];return c(r)||null===r?"":t[e]}var z=decodeURIComponent,D=/; */;function K(t,e){return void 0===e&&(e={}),t?function(t,e){void 0===e&&(e={});if("string"!=typeof t)return{};var r={},n=t.split(D),o=e.decode||z;return n.forEach((function(t){var e=t.indexOf("=");if(!(e<0)){var n=t.substr(0,e).trim(),i=t.substr(e+1,t.length).trim();'"'===i[0]&&(i=i.slice(1,-1)),c(r[n])&&(r[n]=function(t,e){try{return e(t)}catch(e){return t}}(i,o))}})),r}(t,e):{}}var F=function(t,e,r,n,o){this.extra=null,this.errMsg=t,this.config=e,this.status=r,this.response=n,this.extra=o};function G(t,e,r,n,o){return new F(t,e,r||0===r?r:"NETWORK_ERROR",n,o)}function H(t){return n(this,void 0,void 0,(function(){var e,n,i,a;return o(this,(function(o){switch(o.label){case 0:e=function(t){V(t);var e=t.baseURL,n=t.url,o=t.params,i=A(j(n)?n:O(e,n),o,t.paramsSerializer),a=y(t.method),s=r(r({},t),{headers:P(t.headers,a)});s.data=M(s.data,s.headers,s.transformRequest),s.headers=(c=s.headers,f=s.data,p=U(Object.assign(c||{}),["Content-Type"]),u(f)&&!p["Content-Type"]&&(p["Content-Type"]="application/json; charset=utf-8"),null==f&&delete p["Content-Type"],p);var c,f,p;var h=function(t){return t.withCredentials,e=t.headers.Cookies,r=t.xsrfCookieName,n=_(W(t),t.xsrfCookieName),r||String(r)===String(0)?l(e)?e+"; "+L(r,n):n||"0"===String(n)?""+L(r,n):r:e;var e,r,n;return""}(s=I(s,t.transformConfig));h&&(s.headers.Cookies=h);var d=_(W(t),s.xsrfCookieName);d&&(s.headers[s.xsrfHeaderName]=d);return r(r({},s),{url:i,method:a,headers:s.headers,getRequestTask:X(s.getRequestTask),Adapter:m})}(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.adapter(e)];case 2:return n=o.sent(),V(e),u(n.headers)&&(n.cookies=K(U(n.headers,["Set-Cookie"])["Set-Cookie"])),function(t,e){t.autoCookies&&h(t.writeCookies)&&t.writeCookies(R,e)}(t,n.cookies),"function"==typeof t.validateStatus&&t.validateStatus(n.status)?(n.data=M(n.data,n.headers,e.transformResponse),[2,n]):[2,Promise.reject(G("Request failed with status code "+n.status,n.config,n.status,n))];case 3:return d(i=o.sent())?[2,Promise.reject(i)]:(V(e),(a=i)&&a.response&&(a.response.data=M(a.response.data,a.response.headers,e.transformResponse)),a instanceof TypeError?[2,Promise.reject(G(a.message,a.config,"SCRIPT_ERROR",a.response,a))]:[2,Promise.reject(G(a.errMsg,a.config,a.status,a.response,a.extra))]);case 4:return[2]}}))}))}function V(t){t.cancelToken&&t.cancelToken.throwIfRequested()}function X(t){return"function"==typeof t?t:function(){}}var Y,J=new(function(){function t(e){this.AppletsRequest=t,this.CancelToken=a,this.defaults={},this.isCancel=d,this.isTimeout=T,this.isNetworkError=E,e&&(this.defaults=e),this.interceptors={request:new N,response:new N}}return t.prototype.request=function(t,e){var r={};"string"==typeof t?(r=this.transformConfig(e)).url=t:r=t,r=S(this.defaults,r);var n=[{fulfilled:H,rejected:void 0}];this.interceptors.request.forEach((function(t){return n.unshift(t)})),this.interceptors.response.forEach((function(t){return n.push(t)}));var o=Promise.resolve(r);return n.forEach((function(t){t&&(o=o.then(t.fulfilled,t.rejected))})),o},t.prototype.get=function(t,e){return this.requestWithMethod(t,"GET",e)},t.prototype.delete=function(t,e){return this.requestWithMethod(t,"DELETE",e)},t.prototype.head=function(t,e){return this.requestWithMethod(t,"HEAD",e)},t.prototype.options=function(t,e){return this.requestWithMethod(t,"OPTIONS",e)},t.prototype.post=function(t,e,r){return this.requestWithData(t,"POST",e,r)},t.prototype.put=function(t,e,r){return this.requestWithData(t,"PUT",e,r)},t.prototype.create=function(e){var r=new t(S(b(),e));return function(t,e){if(l(e))return t;for(var r in e)t[r]=e[r];return t}(t.prototype.request.bind(r),r)},t.prototype.all=function(t){if(0===t.length)throw new TypeError("arguments length is 0");return Promise.all(t)},t.prototype.getUri=function(t){var e=t.url,r=t.baseURL,n=t.params,o=e||"";return A(j(o)?o:O(r||"",o),n,t.paramsSerializer)},t.prototype.requestWithMethod=function(t,e,n){return this.request(r(r({},this.transformConfig(n)),{url:t,method:e}))},t.prototype.requestWithData=function(t,e,n,o){return this.requestWithMethod(t,e,r(r({},this.transformConfig(o)),{data:n}))},t.prototype.transformConfig=function(t){return u(t)?t:{}},t}())(Y).create(Y),$=function(){return($=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}; | ||
/*! ***************************************************************************** | ||
@@ -44,2 +44,2 @@ Copyright (c) Microsoft Corporation. | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function B(t){if(null===t||"[object Object]"!==function(t){return Object.prototype.toString.call(t)}(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Q(t){return void 0===t}function Z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){B(r[e])&&B(t)?r[e]=Z(r[e],t):B(t)?r[e]=Z({},t):Array.isArray(t)?r[e]=Z(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){et(t,n)})),r}function et(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function rt(t){if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}}function nt(){if("undefined"!=typeof wx||"undefined"!=typeof my)return function(){if("undefined"!=typeof wx)return wx;if("undefined"!=typeof my)return my;if("undefined"!=typeof swan)return swan;if("undefined"!=typeof tt)return tt;throw new TypeError("Unrecognized Platform")}().request;throw new TypeError("Unrecognized Platform")}function ot(t){return"undefined"!=typeof wx?Q(e=t)||null===e?{headers:{},status:200,data:{},response:e}:{headers:e.header,status:e.statusCode,data:rt(e.data),response:e}:"undefined"!=typeof my?function(t){return Q(t)||null===t?{headers:{},status:200,data:{},response:t}:{headers:t.headers,status:t.status,data:rt(t.data),response:t}}(t):t;var e}function it(t){function e(t){var e=Z({},t);return e.headers=t.headers,delete e.header,delete e.Adapter,e}return new Promise((function(r,n){var o=t.Adapter,i=function(t){return"undefined"!=typeof wx?function(t){var e={url:t.url||"",method:t.method,data:t.data,header:t.headers,dataType:"json",timeout:t.timeout},r=t.dataType||"json";return e.dataType=r,t.responseType&&"json"!==t.responseType&&(e.dataType="其他"),e}(t):"undefined"!=typeof my?function(t){var e={url:t.url||"",method:t.method,data:t.data,headers:t.headers,dataType:"json",timeout:t.timeout},r=t.dataType||"json";return e.dataType=r,t.responseType&&"json"!==t.responseType&&(e.dataType="其他"),e}(t):t}(t),a=e(t);if(!o)throw new TypeError("Adapter is undefined or null");var s=new o(a),u=nt()($($({},i),{success:function(t){s.resolve(ot(t),r)},fail:function(t){var e=function(t,e){return t&&(t.errMsg||"").toString().toLowerCase().includes("timeout")?{msg:"Timeout of "+(e||"")+" ms exceeded",type:"TIMEOUT"}:{msg:"Network Error",type:"NETWORK_ERROR"}}(t,i.timeout),r={errMsg:e.msg,status:e.type,extra:t};s.reject(r,n)},complete:function(){u=null}}));s.subscribeCancelEvent((function(t){n(t),u.abort(),u=null})),"function"==typeof t.getRequestTask&&t.getRequestTask(it)}))}function at(t){return it(t)}function st(t){if(null===t||"[object Object]"!==function(t){return Object.prototype.toString.call(t)}(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function ut(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function ct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){st(r[e])&&st(t)?r[e]=ct(r[e],t):st(t)?r[e]=ct({},t):Array.isArray(t)?r[e]=ct(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){ut(t,n)})),r}Y.defaults.adapter=at;var ft=function(){function t(t,e){this.hadRetry=0,this.retryTimes=2,this.interval=2e3,this.baseURL="",this.url="",this.fnName="",this.method="GET";var r=t.retryTimes,n=t.interval;this.baseURL=t.baseURL,this.url=t.url,this.fnName=t.fnName,this.method=t.method||this.method,this.retryTimes=this.getValidNumber(this.retryTimes,r),this.interval=this.getValidNumber(this.interval,n),this.appletsRequest=e}return t.prototype.getValidNumber=function(t,e){return e||0===e?e:t},t.prototype.http=function(t){var r=this;return new Promise((function(n,o){r.request(e(e({},t||{}),{url:r.url,method:r.method}),n,o)}))},t.prototype.request=function(t,e,r){var n=this;Promise.resolve(t).then((function(t){return n.appletsRequest(t)})).then((function(t){n.hadRetry=0,e(t)})).catch((function(o){if(n.isRetryError(o)&&n.hadRetry<n.retryTimes){n.hadRetry+=1;var i=ct(t,o.options||{});n.request(i,e,r)}else n.isIntervalRetryError(o)&&n.hadRetry<n.retryTimes?setTimeout((function(){n.hadRetry+=1,n.request(t,e,r)}),n.interval):r(n.isRetryError(o)?o.originalErr:o)}))},t.prototype.isRetryError=function(t){return!!t&&"RETRY_ERROR"===t.errCode},t.prototype.isIntervalRetryError=function(t){return!!t&&("NETWORK_ERROR"===t.status||"TIMEOUT"===t.status)},t}(),pt=function(){function t(t,r){var n;this.apiList=Object.create(null),this.apis=Object.create(null),this.baseURL=t.baseURL,this.appletsRequest=Y.create(e(e({},ct(((n=R()).adapter=at,n),r||{})),{baseURL:this.baseURL})),this.createApiItem(t.apiList)}return t.prototype.createApiItem=function(t){if(o=t,Array.isArray(o)){var r=Object.create(null);t.forEach((function(t){t.fnName&&(r[t.fnName]=t)}));var n=t.map((function(t){return t.fnName}));return this.apiList=e(e({},this.apiList),r),void this.generateApiFn(n)}var o;if(st(t)){this.apiList=e(e({},this.apiList),t);n=Object.keys(t);this.generateApiFn(n)}},t.prototype.generateApiFn=function(t){var r=this;t.forEach((function(t){var n=r.apiList[t],o={baseURL:r.baseURL,fnName:t,method:n.method,url:n.apiUrl,interval:n.interval,retryTimes:n.retryTimes};if("function"==typeof r.apis[t])throw new Error(t+" already exists in apiList");r.apis[t]=function(t){var i=new ft(o,r.appletsRequest),a=e(e({},t||{}),{apiConfig:n});return i.http(a)},r.apis[t]=function(t,e){if("string"==typeof e)return t;for(var r in e)t[r]=e[r];return t}(r.apis[t],o)}))},t.prototype.addApiList=function(t){this.createApiItem(t)},t.prototype.createRetryError=function(t,e){return{errCode:"RETRY_ERROR",originalErr:t,options:e}},t.prototype.addRequestInterceptor=function(t,e){this.appletsRequest.interceptors.request.use(t,e)},t.prototype.addResponseInterceptor=function(t,e){this.appletsRequest.interceptors.response.use(t,e)},t.prototype.createCancelToken=function(){return new this.appletsRequest.CancelToken},t.prototype.transformConfig=function(t){this.appletsRequest.defaults.transformConfig=t},t}();t.default=pt,Object.defineProperty(t,"__esModule",{value:!0})}));//# sourceMappingURL=applets-request-mode-list.min.js.map | ||
***************************************************************************** */function B(t){if(null===t||"[object Object]"!==function(t){return Object.prototype.toString.call(t)}(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Q(t){return void 0===t}function Z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){B(r[e])&&B(t)?r[e]=Z(r[e],t):B(t)?r[e]=Z({},t):Array.isArray(t)?r[e]=Z(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){et(t,n)})),r}function et(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function rt(t){if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}}function nt(){if("undefined"!=typeof wx||"undefined"!=typeof my)return function(){if("undefined"!=typeof wx)return wx;if("undefined"!=typeof my)return my;if("undefined"!=typeof swan)return swan;if("undefined"!=typeof tt)return tt;throw new TypeError("Unrecognized Platform")}().request;throw new TypeError("Unrecognized Platform")}function ot(t){return"undefined"!=typeof wx?Q(e=t)||null===e?{headers:{},status:200,data:{},response:e}:{headers:e.header,status:e.statusCode,data:rt(e.data),response:e}:"undefined"!=typeof my?function(t){return Q(t)||null===t?{headers:{},status:200,data:{},response:t}:{headers:t.headers,status:t.status,data:rt(t.data),response:t}}(t):t;var e}function it(t){function e(t){var e=Z({},t);return e.headers=t.headers,delete e.header,delete e.Adapter,e}return new Promise((function(r,n){var o=t.Adapter,i=function(t){return"undefined"!=typeof wx?function(t){var e={url:t.url||"",method:t.method,data:t.data,header:t.headers,dataType:"json",timeout:t.timeout},r=t.dataType||"json";return e.dataType=r,t.responseType&&"json"!==t.responseType&&(e.dataType="其他"),e}(t):"undefined"!=typeof my?function(t){var e={url:t.url||"",method:t.method,data:t.data,headers:t.headers,dataType:"json",timeout:t.timeout},r=t.dataType||"json";return e.dataType=r,t.responseType&&"json"!==t.responseType&&(e.dataType="其他"),e}(t):t}(t),a=e(t);if(!o)throw new TypeError("Adapter is undefined or null");var s=new o(a),u=nt()($($({},i),{success:function(t){s.resolve(ot(t),r)},fail:function(t){var e=function(t,e){return t&&(t.errMsg||"").toString().toLowerCase().includes("timeout")?{msg:"Timeout of "+(e||"")+" ms exceeded",type:"TIMEOUT"}:{msg:"Network Error",type:"NETWORK_ERROR"}}(t,i.timeout),r={errMsg:e.msg,status:e.type,extra:t};s.reject(r,n)},complete:function(){u=null}}));s.subscribeCancelEvent((function(t){n(t),u.abort(),u=null})),"function"==typeof t.getRequestTask&&t.getRequestTask(it)}))}function at(t){return it(t)}function st(t){if(null===t||"[object Object]"!==function(t){return Object.prototype.toString.call(t)}(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function ut(t,e){if(null!=t){var r=t;"object"!=typeof t&&(r=[t]),Array.isArray(r)?r.forEach((function(r,n){e.call(null,r,n,t)})):Object.keys(r).forEach((function(t){e.call(null,r[t],t,r)}))}}function ct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return Object.create(null);var r=Object.create(null);function n(t,e){st(r[e])&&st(t)?r[e]=ct(r[e],t):st(t)?r[e]=ct({},t):Array.isArray(t)?r[e]=ct(t):r[e]=t}return r=Array.isArray(t[0])?[]:Object.create(null),t.forEach((function(t){ut(t,n)})),r}J.defaults.adapter=at;var ft=function(){function t(t,e){this.hadRetry=0,this.retryTimes=2,this.interval=2e3,this.baseURL="",this.url="",this.fnName="",this.method="GET";var r=t.retryTimes,n=t.interval;this.baseURL=t.baseURL,this.url=t.url,this.fnName=t.fnName,this.method=t.method||this.method,this.retryTimes=this.getValidNumber(this.retryTimes,r),this.interval=this.getValidNumber(this.interval,n),this.appletsRequest=e}return t.prototype.getValidNumber=function(t,e){return e||0===e?e:t},t.prototype.http=function(t){var r=this;return new Promise((function(n,o){r.request(e(e({},t||{}),{url:r.url,method:r.method}),n,o)}))},t.prototype.request=function(t,e,r){var n=this;Promise.resolve(t).then((function(t){return n.appletsRequest(t)})).then((function(t){n.hadRetry=0,e(t)})).catch((function(o){if(n.isRetryError(o)&&n.hadRetry<n.retryTimes){n.hadRetry+=1;var i=ct(t,o.options||{});n.request(i,e,r)}else n.isIntervalRetryError(o)&&n.hadRetry<n.retryTimes?setTimeout((function(){n.hadRetry+=1,n.request(t,e,r)}),n.interval):r(n.isRetryError(o)?o.originalErr:o)}))},t.prototype.isRetryError=function(t){return!!t&&"RETRY_ERROR"===t.errCode},t.prototype.isIntervalRetryError=function(t){return!!t&&("NETWORK_ERROR"===t.status||"TIMEOUT"===t.status)},t}(),pt=function(){function t(t,r){var n;this.apiList=Object.create(null),this.apis=Object.create(null),this.baseURL=t.baseURL,this.appletsRequest=J.create(e(e({},ct(((n=b()).adapter=at,n),r||{})),{baseURL:this.baseURL})),this.createApiItem(t.apiList)}return t.prototype.createApiItem=function(t){if(o=t,Array.isArray(o)){var r=Object.create(null);t.forEach((function(t){t.fnName&&(r[t.fnName]=t)}));var n=t.map((function(t){return t.fnName}));return this.apiList=e(e({},this.apiList),r),void this.generateApiFn(n)}var o;if(st(t)){this.apiList=e(e({},this.apiList),t);n=Object.keys(t);this.generateApiFn(n)}},t.prototype.generateApiFn=function(t){var r=this;t.forEach((function(t){var n=r.apiList[t],o={baseURL:r.baseURL,fnName:t,method:n.method,url:n.apiUrl,interval:n.interval,retryTimes:n.retryTimes};if("function"==typeof r.apis[t])throw new Error(t+" already exists in apiList");r.apis[t]=function(t){var i=new ft(o,r.appletsRequest),a=e(e({},t||{}),{apiConfig:n});return i.http(a)},r.apis[t]=function(t,e){if("string"==typeof e)return t;for(var r in e)t[r]=e[r];return t}(r.apis[t],o)}))},t.prototype.addApiList=function(t){this.createApiItem(t)},t.prototype.createRetryError=function(t,e){return{errCode:"RETRY_ERROR",originalErr:t,options:e}},t.prototype.addRequestInterceptor=function(t,e){this.appletsRequest.interceptors.request.use(t,e)},t.prototype.addResponseInterceptor=function(t,e){this.appletsRequest.interceptors.response.use(t,e)},t.prototype.createCancelToken=function(){return new this.appletsRequest.CancelToken},t.prototype.transformConfig=function(t){this.appletsRequest.defaults.transformConfig=t},t.prototype.isRetryError=function(t){return!!t&&"RETRY_ERROR"===t.errCode},t}();t.default=pt,Object.defineProperty(t,"__esModule",{value:!0})}));//# sourceMappingURL=applets-request-mode-list.min.js.map |
@@ -21,2 +21,3 @@ export default class ApiHttp { | ||
transformConfig(executor: IAppletsRequest.IConfigTransformer): void; | ||
isRetryError(err: any): boolean; | ||
} |
@@ -154,2 +154,8 @@ "use strict"; | ||
}; | ||
ApiHttp.prototype.isRetryError = function (err) { | ||
if (!err) { | ||
return false; | ||
} | ||
return err.errCode === "RETRY_ERROR"; | ||
}; | ||
return ApiHttp; | ||
@@ -156,0 +162,0 @@ }()); |
{ | ||
"name": "applets-request-mode-list", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "mini program axios request wechat weapp alipay", | ||
@@ -5,0 +5,0 @@ "main": "dist/applets-request-mode-list.min.js", |
@@ -71,4 +71,9 @@ /* eslint-disable @typescript-eslint/triple-slash-reference */ | ||
addApiList(apiList: IAppletsApi.IApiItems): void; | ||
/** | ||
* 是否是重试错误 | ||
*/ | ||
isRetryError(err: any): boolean; | ||
} | ||
export default ApiHttp; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
178505
0.61%1020
1.69%