5 lines
110 KiB
JavaScript
5 lines
110 KiB
JavaScript
|
define("taro.js", function(require, module, exports, window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,fetch,XMLHttpRequest,WebSocket,webkit,ttJSCore,Reporter,print,indexedDB){
|
||
|
/*! For license information please see taro.js.LICENSE.txt */
|
||
|
(tt["webpackJsonp"]=tt["webpackJsonp"]||[]).push([[3],{1e3:function(e,t,n){"use strict";n.r(t),function(e,r){var i=n(536),o=n.n(i),a=n(833),c=n.n(a),u=n(732),s=n.n(u),l=n(733),d=n.n(l),f=n(721),p=n.n(f),h=n(15);"function"!==typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),"function"!==typeof Object.defineProperties&&(Object.defineProperties=function(e,t){function n(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return"function"===typeof e}if("object"!==o()(e)||null===e)throw new TypeError("bad desc");var r={};if(t(e,"enumerable")&&(r.enumerable=!!e.enumerable),t(e,"configurable")&&(r.configurable=!!e.configurable),t(e,"value")&&(r.value=e.value),t(e,"writable")&&(r.writable=!!e.writable),t(e,"get")){var i=e.get;if(!n(i)&&"undefined"!==typeof i)throw new TypeError("bad get");r.get=i}if(t(e,"set")){var a=e.set;if(!n(a)&&"undefined"!==typeof a)throw new TypeError("bad set");r.set=a}if(("get"in r||"set"in r)&&("value"in r||"writable"in r))throw new TypeError("identity-confused descriptor");return r}if("object"!==o()(e)||null===e)throw new TypeError("bad obj");t=Object(t);for(var r=Object.keys(t),i=[],a=0;a<r.length;a++)i.push([r[a],n(t[r[a]])]);for(var c=0;c<i.length;c++)Object.defineProperty(e,i[c][0],i[c][1]);return e});var v={WEAPP:"WEAPP",WEB:"WEB",RN:"RN",SWAN:"SWAN",ALIPAY:"ALIPAY",TT:"TT",QQ:"QQ",JD:"JD",KWAI:"KWAI"},m=null;function b(){return m||("undefined"!==typeof jd&&jd.getSystemInfo?(m=v.JD,v.JD):"undefined"!==typeof qq&&qq.getSystemInfo?(m=v.QQ,v.QQ):"undefined"!==typeof tt&&tt.getSystemInfo?(m=v.TT,v.TT):"undefined"!==typeof wx&&wx.getSystemInfo?(m=v.WEAPP,v.WEAPP):"undefined"!==typeof swan&&swan.getSystemInfo?(m=v.SWAN,v.SWAN):"undefined"!==typeof my&&my.getSystemInfo?(m=v.ALIPAY,v.ALIPAY):"undefined"!==typeof ks&&ks.getSystemInfo?(m=v.KWAI,v.KWAI):"undefined"!==typeof e&&e.__fbGenNativeModule?(m=v.RN,v.RN):"undefined"!==typeof r?(m=v.WEB,v.WEB):"Unknown environment")}var y=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s()(this,e),this.index=r,this.requestParams=t,this.interceptors=n}return d()(e,[{key:"proceed",value:function(e){if(this.requestParams=e,this.index>=this.interceptors.length)throw new Error("chain \u53c2\u6570\u9519\u8bef, \u8bf7\u52ff\u76f4\u63a5\u4fee\u6539 request.chain");var t=this._getNextInterceptor(),n=this._getNextChain(),r=t(n),i=r.catch((function(e){return Promise.reject(e)}));return"function"===typeof r.abort&&(i.abort=r.abort),i}},{key:"_getNextInterceptor",value:function(){return this.interceptors[this.index]}},{key:"_getNextChain",value:function(){return new e(this.requestParams,this.interceptors,this.index+1)}}]),e}(),g=function(){function e(t){s()(this,e),this.taroInterceptor=t,this.chain=new y}return d()(e,[{key:"request",value:function(e){var t=this;return this.chain.interceptors=this.chain.interceptors.filter((function(e){return e!==t.taroInterceptor})),this.chain.interceptors.push(this.taroInterceptor),this.chain.proceed(c()({},e))}},{key:"addInterceptor",value:function(e){this.chain.interceptors.push(e)}},{key:"cleanInterceptors",value:function(){this.chain=new y}}]),e}();function O(e){var t,n=e.requestParams,r=new Promise((function(r,i){var o=setTimeout((function(){o=null,i(new Error("\u7f51\u7edc\u94fe\u63a5\u8d85\u65f6,\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01"))}),n&&n.timeout||6e4);t=e.proceed(n),t.then((function(e){o&&(clearTimeout(o),r(e))})).catch((function(e){o&&clearTimeout(o),i(e)}))}));return void 0!==t&&"function"===typeof t.abort&&(r.abort=t.abort),r}function j(e){var t=e.requestParams,n=t.method,r=t.data,i=t.url;console.log("http ".concat(n||"GET"," --\x3e ").concat(i," data: "),r);var o=e.proceed(t),a=o.then((function(e){return console.log("http <-- ".concat(i," result:"),e),e}));return"function"
|
||
|
//# sourceMappingURL=taro.js.map
|
||
|
});
|