1 |
|
2 | (function webpackUniversalModuleDefinition(root, factory) {
|
3 | if(typeof exports === 'object' && typeof module === 'object')
|
4 | module.exports = factory();
|
5 | else if(typeof define === 'function' && define.amd)
|
6 | define([], factory);
|
7 | else if(typeof exports === 'object')
|
8 | exports["axios"] = factory();
|
9 | else
|
10 | root["axios"] = factory();
|
11 | })(this, function() {
|
12 | return (function(modules) {
|
13 |
|
14 | var installedModules = {};
|
15 |
|
16 |
|
17 | function __webpack_require__(moduleId) {
|
18 |
|
19 |
|
20 | if(installedModules[moduleId])
|
21 | return installedModules[moduleId].exports;
|
22 |
|
23 |
|
24 | var module = installedModules[moduleId] = {
|
25 | exports: {},
|
26 | id: moduleId,
|
27 | loaded: false
|
28 | };
|
29 |
|
30 |
|
31 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
32 |
|
33 |
|
34 | module.loaded = true;
|
35 |
|
36 |
|
37 | return module.exports;
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 | __webpack_require__.m = modules;
|
43 |
|
44 |
|
45 | __webpack_require__.c = installedModules;
|
46 |
|
47 |
|
48 | __webpack_require__.p = "";
|
49 |
|
50 |
|
51 | return __webpack_require__(0);
|
52 | })
|
53 |
|
54 | ([
|
55 |
|
56 | (function(module, exports, __webpack_require__) {
|
57 |
|
58 | module.exports = __webpack_require__(1);
|
59 |
|
60 | }),
|
61 |
|
62 | (function(module, exports, __webpack_require__) {
|
63 |
|
64 | 'use strict';
|
65 |
|
66 | var utils = __webpack_require__(2);
|
67 | var bind = __webpack_require__(3);
|
68 | var Axios = __webpack_require__(4);
|
69 | var mergeConfig = __webpack_require__(22);
|
70 | var defaults = __webpack_require__(10);
|
71 |
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | function createInstance(defaultConfig) {
|
79 | var context = new Axios(defaultConfig);
|
80 | var instance = bind(Axios.prototype.request, context);
|
81 |
|
82 |
|
83 | utils.extend(instance, Axios.prototype, context);
|
84 |
|
85 |
|
86 | utils.extend(instance, context);
|
87 |
|
88 | return instance;
|
89 | }
|
90 |
|
91 |
|
92 | var axios = createInstance(defaults);
|
93 |
|
94 |
|
95 | axios.Axios = Axios;
|
96 |
|
97 |
|
98 | axios.create = function create(instanceConfig) {
|
99 | return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
100 | };
|
101 |
|
102 |
|
103 | axios.Cancel = __webpack_require__(23);
|
104 | axios.CancelToken = __webpack_require__(24);
|
105 | axios.isCancel = __webpack_require__(9);
|
106 |
|
107 |
|
108 | axios.all = function all(promises) {
|
109 | return Promise.all(promises);
|
110 | };
|
111 | axios.spread = __webpack_require__(25);
|
112 |
|
113 |
|
114 | axios.isAxiosError = __webpack_require__(26);
|
115 |
|
116 | module.exports = axios;
|
117 |
|
118 |
|
119 | module.exports.default = axios;
|
120 |
|
121 |
|
122 | }),
|
123 |
|
124 | (function(module, exports, __webpack_require__) {
|
125 |
|
126 | 'use strict';
|
127 |
|
128 | var bind = __webpack_require__(3);
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | var toString = Object.prototype.toString;
|
135 |
|
136 | |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 | function isArray(val) {
|
143 | return toString.call(val) === '[object Array]';
|
144 | }
|
145 |
|
146 | |
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | function isUndefined(val) {
|
153 | return typeof val === 'undefined';
|
154 | }
|
155 |
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | function isBuffer(val) {
|
163 | return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
164 | && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
165 | }
|
166 |
|
167 | |
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 | function isArrayBuffer(val) {
|
174 | return toString.call(val) === '[object ArrayBuffer]';
|
175 | }
|
176 |
|
177 | |
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 | function isFormData(val) {
|
184 | return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
185 | }
|
186 |
|
187 | |
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 | function isArrayBufferView(val) {
|
194 | var result;
|
195 | if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
196 | result = ArrayBuffer.isView(val);
|
197 | } else {
|
198 | result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
199 | }
|
200 | return result;
|
201 | }
|
202 |
|
203 | |
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 | function isString(val) {
|
210 | return typeof val === 'string';
|
211 | }
|
212 |
|
213 | |
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | function isNumber(val) {
|
220 | return typeof val === 'number';
|
221 | }
|
222 |
|
223 | |
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | function isObject(val) {
|
230 | return val !== null && typeof val === 'object';
|
231 | }
|
232 |
|
233 | |
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 | function isPlainObject(val) {
|
240 | if (toString.call(val) !== '[object Object]') {
|
241 | return false;
|
242 | }
|
243 |
|
244 | var prototype = Object.getPrototypeOf(val);
|
245 | return prototype === null || prototype === Object.prototype;
|
246 | }
|
247 |
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 | function isDate(val) {
|
255 | return toString.call(val) === '[object Date]';
|
256 | }
|
257 |
|
258 | |
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 | function isFile(val) {
|
265 | return toString.call(val) === '[object File]';
|
266 | }
|
267 |
|
268 | |
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 | function isBlob(val) {
|
275 | return toString.call(val) === '[object Blob]';
|
276 | }
|
277 |
|
278 | |
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 | function isFunction(val) {
|
285 | return toString.call(val) === '[object Function]';
|
286 | }
|
287 |
|
288 | |
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 | function isStream(val) {
|
295 | return isObject(val) && isFunction(val.pipe);
|
296 | }
|
297 |
|
298 | |
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 | function isURLSearchParams(val) {
|
305 | return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
306 | }
|
307 |
|
308 | |
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 | function trim(str) {
|
315 | return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
316 | }
|
317 |
|
318 | |
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 | function isStandardBrowserEnv() {
|
334 | if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
335 | navigator.product === 'NativeScript' ||
|
336 | navigator.product === 'NS')) {
|
337 | return false;
|
338 | }
|
339 | return (
|
340 | typeof window !== 'undefined' &&
|
341 | typeof document !== 'undefined'
|
342 | );
|
343 | }
|
344 |
|
345 | |
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | function forEach(obj, fn) {
|
358 |
|
359 | if (obj === null || typeof obj === 'undefined') {
|
360 | return;
|
361 | }
|
362 |
|
363 |
|
364 | if (typeof obj !== 'object') {
|
365 |
|
366 | obj = [obj];
|
367 | }
|
368 |
|
369 | if (isArray(obj)) {
|
370 |
|
371 | for (var i = 0, l = obj.length; i < l; i++) {
|
372 | fn.call(null, obj[i], i, obj);
|
373 | }
|
374 | } else {
|
375 |
|
376 | for (var key in obj) {
|
377 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
378 | fn.call(null, obj[key], key, obj);
|
379 | }
|
380 | }
|
381 | }
|
382 | }
|
383 |
|
384 | |
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 | function merge(/* obj1, obj2, obj3, ... */) {
|
402 | var result = {};
|
403 | function assignValue(val, key) {
|
404 | if (isPlainObject(result[key]) && isPlainObject(val)) {
|
405 | result[key] = merge(result[key], val);
|
406 | } else if (isPlainObject(val)) {
|
407 | result[key] = merge({}, val);
|
408 | } else if (isArray(val)) {
|
409 | result[key] = val.slice();
|
410 | } else {
|
411 | result[key] = val;
|
412 | }
|
413 | }
|
414 |
|
415 | for (var i = 0, l = arguments.length; i < l; i++) {
|
416 | forEach(arguments[i], assignValue);
|
417 | }
|
418 | return result;
|
419 | }
|
420 |
|
421 | |
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 | function extend(a, b, thisArg) {
|
430 | forEach(b, function assignValue(val, key) {
|
431 | if (thisArg && typeof val === 'function') {
|
432 | a[key] = bind(val, thisArg);
|
433 | } else {
|
434 | a[key] = val;
|
435 | }
|
436 | });
|
437 | return a;
|
438 | }
|
439 |
|
440 | |
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | function stripBOM(content) {
|
447 | if (content.charCodeAt(0) === 0xFEFF) {
|
448 | content = content.slice(1);
|
449 | }
|
450 | return content;
|
451 | }
|
452 |
|
453 | module.exports = {
|
454 | isArray: isArray,
|
455 | isArrayBuffer: isArrayBuffer,
|
456 | isBuffer: isBuffer,
|
457 | isFormData: isFormData,
|
458 | isArrayBufferView: isArrayBufferView,
|
459 | isString: isString,
|
460 | isNumber: isNumber,
|
461 | isObject: isObject,
|
462 | isPlainObject: isPlainObject,
|
463 | isUndefined: isUndefined,
|
464 | isDate: isDate,
|
465 | isFile: isFile,
|
466 | isBlob: isBlob,
|
467 | isFunction: isFunction,
|
468 | isStream: isStream,
|
469 | isURLSearchParams: isURLSearchParams,
|
470 | isStandardBrowserEnv: isStandardBrowserEnv,
|
471 | forEach: forEach,
|
472 | merge: merge,
|
473 | extend: extend,
|
474 | trim: trim,
|
475 | stripBOM: stripBOM
|
476 | };
|
477 |
|
478 |
|
479 | }),
|
480 |
|
481 | (function(module, exports) {
|
482 |
|
483 | 'use strict';
|
484 |
|
485 | module.exports = function bind(fn, thisArg) {
|
486 | return function wrap() {
|
487 | var args = new Array(arguments.length);
|
488 | for (var i = 0; i < args.length; i++) {
|
489 | args[i] = arguments[i];
|
490 | }
|
491 | return fn.apply(thisArg, args);
|
492 | };
|
493 | };
|
494 |
|
495 |
|
496 | }),
|
497 |
|
498 | (function(module, exports, __webpack_require__) {
|
499 |
|
500 | 'use strict';
|
501 |
|
502 | var utils = __webpack_require__(2);
|
503 | var buildURL = __webpack_require__(5);
|
504 | var InterceptorManager = __webpack_require__(6);
|
505 | var dispatchRequest = __webpack_require__(7);
|
506 | var mergeConfig = __webpack_require__(22);
|
507 |
|
508 | |
509 |
|
510 |
|
511 |
|
512 |
|
513 | function Axios(instanceConfig) {
|
514 | this.defaults = instanceConfig;
|
515 | this.interceptors = {
|
516 | request: new InterceptorManager(),
|
517 | response: new InterceptorManager()
|
518 | };
|
519 | }
|
520 |
|
521 | |
522 |
|
523 |
|
524 |
|
525 |
|
526 | Axios.prototype.request = function request(config) {
|
527 |
|
528 |
|
529 | if (typeof config === 'string') {
|
530 | config = arguments[1] || {};
|
531 | config.url = arguments[0];
|
532 | } else {
|
533 | config = config || {};
|
534 | }
|
535 |
|
536 | config = mergeConfig(this.defaults, config);
|
537 |
|
538 |
|
539 | if (config.method) {
|
540 | config.method = config.method.toLowerCase();
|
541 | } else if (this.defaults.method) {
|
542 | config.method = this.defaults.method.toLowerCase();
|
543 | } else {
|
544 | config.method = 'get';
|
545 | }
|
546 |
|
547 |
|
548 | var chain = [dispatchRequest, undefined];
|
549 | var promise = Promise.resolve(config);
|
550 |
|
551 | this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
552 | chain.unshift(interceptor.fulfilled, interceptor.rejected);
|
553 | });
|
554 |
|
555 | this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
556 | chain.push(interceptor.fulfilled, interceptor.rejected);
|
557 | });
|
558 |
|
559 | while (chain.length) {
|
560 | promise = promise.then(chain.shift(), chain.shift());
|
561 | }
|
562 |
|
563 | return promise;
|
564 | };
|
565 |
|
566 | Axios.prototype.getUri = function getUri(config) {
|
567 | config = mergeConfig(this.defaults, config);
|
568 | return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
569 | };
|
570 |
|
571 |
|
572 | utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
573 |
|
574 | Axios.prototype[method] = function(url, config) {
|
575 | return this.request(mergeConfig(config || {}, {
|
576 | method: method,
|
577 | url: url,
|
578 | data: (config || {}).data
|
579 | }));
|
580 | };
|
581 | });
|
582 |
|
583 | utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
584 |
|
585 | Axios.prototype[method] = function(url, data, config) {
|
586 | return this.request(mergeConfig(config || {}, {
|
587 | method: method,
|
588 | url: url,
|
589 | data: data
|
590 | }));
|
591 | };
|
592 | });
|
593 |
|
594 | module.exports = Axios;
|
595 |
|
596 |
|
597 | }),
|
598 |
|
599 | (function(module, exports, __webpack_require__) {
|
600 |
|
601 | 'use strict';
|
602 |
|
603 | var utils = __webpack_require__(2);
|
604 |
|
605 | function encode(val) {
|
606 | return encodeURIComponent(val).
|
607 | replace(/%3A/gi, ':').
|
608 | replace(/%24/g, '$').
|
609 | replace(/%2C/gi, ',').
|
610 | replace(/%20/g, '+').
|
611 | replace(/%5B/gi, '[').
|
612 | replace(/%5D/gi, ']');
|
613 | }
|
614 |
|
615 | |
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 | module.exports = function buildURL(url, params, paramsSerializer) {
|
623 |
|
624 | if (!params) {
|
625 | return url;
|
626 | }
|
627 |
|
628 | var serializedParams;
|
629 | if (paramsSerializer) {
|
630 | serializedParams = paramsSerializer(params);
|
631 | } else if (utils.isURLSearchParams(params)) {
|
632 | serializedParams = params.toString();
|
633 | } else {
|
634 | var parts = [];
|
635 |
|
636 | utils.forEach(params, function serialize(val, key) {
|
637 | if (val === null || typeof val === 'undefined') {
|
638 | return;
|
639 | }
|
640 |
|
641 | if (utils.isArray(val)) {
|
642 | key = key + '[]';
|
643 | } else {
|
644 | val = [val];
|
645 | }
|
646 |
|
647 | utils.forEach(val, function parseValue(v) {
|
648 | if (utils.isDate(v)) {
|
649 | v = v.toISOString();
|
650 | } else if (utils.isObject(v)) {
|
651 | v = JSON.stringify(v);
|
652 | }
|
653 | parts.push(encode(key) + '=' + encode(v));
|
654 | });
|
655 | });
|
656 |
|
657 | serializedParams = parts.join('&');
|
658 | }
|
659 |
|
660 | if (serializedParams) {
|
661 | var hashmarkIndex = url.indexOf('#');
|
662 | if (hashmarkIndex !== -1) {
|
663 | url = url.slice(0, hashmarkIndex);
|
664 | }
|
665 |
|
666 | url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
667 | }
|
668 |
|
669 | return url;
|
670 | };
|
671 |
|
672 |
|
673 | }),
|
674 |
|
675 | (function(module, exports, __webpack_require__) {
|
676 |
|
677 | 'use strict';
|
678 |
|
679 | var utils = __webpack_require__(2);
|
680 |
|
681 | function InterceptorManager() {
|
682 | this.handlers = [];
|
683 | }
|
684 |
|
685 | |
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 | InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
694 | this.handlers.push({
|
695 | fulfilled: fulfilled,
|
696 | rejected: rejected
|
697 | });
|
698 | return this.handlers.length - 1;
|
699 | };
|
700 |
|
701 | |
702 |
|
703 |
|
704 |
|
705 |
|
706 | InterceptorManager.prototype.eject = function eject(id) {
|
707 | if (this.handlers[id]) {
|
708 | this.handlers[id] = null;
|
709 | }
|
710 | };
|
711 |
|
712 | |
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 | InterceptorManager.prototype.forEach = function forEach(fn) {
|
721 | utils.forEach(this.handlers, function forEachHandler(h) {
|
722 | if (h !== null) {
|
723 | fn(h);
|
724 | }
|
725 | });
|
726 | };
|
727 |
|
728 | module.exports = InterceptorManager;
|
729 |
|
730 |
|
731 | }),
|
732 |
|
733 | (function(module, exports, __webpack_require__) {
|
734 |
|
735 | 'use strict';
|
736 |
|
737 | var utils = __webpack_require__(2);
|
738 | var transformData = __webpack_require__(8);
|
739 | var isCancel = __webpack_require__(9);
|
740 | var defaults = __webpack_require__(10);
|
741 |
|
742 | |
743 |
|
744 |
|
745 | function throwIfCancellationRequested(config) {
|
746 | if (config.cancelToken) {
|
747 | config.cancelToken.throwIfRequested();
|
748 | }
|
749 | }
|
750 |
|
751 | |
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 | module.exports = function dispatchRequest(config) {
|
758 | throwIfCancellationRequested(config);
|
759 |
|
760 |
|
761 | config.headers = config.headers || {};
|
762 |
|
763 |
|
764 | config.data = transformData(
|
765 | config.data,
|
766 | config.headers,
|
767 | config.transformRequest
|
768 | );
|
769 |
|
770 |
|
771 | config.headers = utils.merge(
|
772 | config.headers.common || {},
|
773 | config.headers[config.method] || {},
|
774 | config.headers
|
775 | );
|
776 |
|
777 | utils.forEach(
|
778 | ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
779 | function cleanHeaderConfig(method) {
|
780 | delete config.headers[method];
|
781 | }
|
782 | );
|
783 |
|
784 | var adapter = config.adapter || defaults.adapter;
|
785 |
|
786 | return adapter(config).then(function onAdapterResolution(response) {
|
787 | throwIfCancellationRequested(config);
|
788 |
|
789 |
|
790 | response.data = transformData(
|
791 | response.data,
|
792 | response.headers,
|
793 | config.transformResponse
|
794 | );
|
795 |
|
796 | return response;
|
797 | }, function onAdapterRejection(reason) {
|
798 | if (!isCancel(reason)) {
|
799 | throwIfCancellationRequested(config);
|
800 |
|
801 |
|
802 | if (reason && reason.response) {
|
803 | reason.response.data = transformData(
|
804 | reason.response.data,
|
805 | reason.response.headers,
|
806 | config.transformResponse
|
807 | );
|
808 | }
|
809 | }
|
810 |
|
811 | return Promise.reject(reason);
|
812 | });
|
813 | };
|
814 |
|
815 |
|
816 | }),
|
817 |
|
818 | (function(module, exports, __webpack_require__) {
|
819 |
|
820 | 'use strict';
|
821 |
|
822 | var utils = __webpack_require__(2);
|
823 |
|
824 | |
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 | module.exports = function transformData(data, headers, fns) {
|
833 |
|
834 | utils.forEach(fns, function transform(fn) {
|
835 | data = fn(data, headers);
|
836 | });
|
837 |
|
838 | return data;
|
839 | };
|
840 |
|
841 |
|
842 | }),
|
843 |
|
844 | (function(module, exports) {
|
845 |
|
846 | 'use strict';
|
847 |
|
848 | module.exports = function isCancel(value) {
|
849 | return !!(value && value.__CANCEL__);
|
850 | };
|
851 |
|
852 |
|
853 | }),
|
854 |
|
855 | (function(module, exports, __webpack_require__) {
|
856 |
|
857 | 'use strict';
|
858 |
|
859 | var utils = __webpack_require__(2);
|
860 | var normalizeHeaderName = __webpack_require__(11);
|
861 |
|
862 | var DEFAULT_CONTENT_TYPE = {
|
863 | 'Content-Type': 'application/x-www-form-urlencoded'
|
864 | };
|
865 |
|
866 | function setContentTypeIfUnset(headers, value) {
|
867 | if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
868 | headers['Content-Type'] = value;
|
869 | }
|
870 | }
|
871 |
|
872 | function getDefaultAdapter() {
|
873 | var adapter;
|
874 | if (typeof XMLHttpRequest !== 'undefined') {
|
875 |
|
876 | adapter = __webpack_require__(12);
|
877 | } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
878 |
|
879 | adapter = __webpack_require__(12);
|
880 | }
|
881 | return adapter;
|
882 | }
|
883 |
|
884 | var defaults = {
|
885 | adapter: getDefaultAdapter(),
|
886 |
|
887 | transformRequest: [function transformRequest(data, headers) {
|
888 | normalizeHeaderName(headers, 'Accept');
|
889 | normalizeHeaderName(headers, 'Content-Type');
|
890 | if (utils.isFormData(data) ||
|
891 | utils.isArrayBuffer(data) ||
|
892 | utils.isBuffer(data) ||
|
893 | utils.isStream(data) ||
|
894 | utils.isFile(data) ||
|
895 | utils.isBlob(data)
|
896 | ) {
|
897 | return data;
|
898 | }
|
899 | if (utils.isArrayBufferView(data)) {
|
900 | return data.buffer;
|
901 | }
|
902 | if (utils.isURLSearchParams(data)) {
|
903 | setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
904 | return data.toString();
|
905 | }
|
906 | if (utils.isObject(data)) {
|
907 | setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
|
908 | return JSON.stringify(data);
|
909 | }
|
910 | return data;
|
911 | }],
|
912 |
|
913 | transformResponse: [function transformResponse(data) {
|
914 |
|
915 | if (typeof data === 'string') {
|
916 | try {
|
917 | data = JSON.parse(data);
|
918 | } catch (e) { }
|
919 | }
|
920 | return data;
|
921 | }],
|
922 |
|
923 | |
924 |
|
925 |
|
926 |
|
927 | timeout: 0,
|
928 |
|
929 | xsrfCookieName: 'XSRF-TOKEN',
|
930 | xsrfHeaderName: 'X-XSRF-TOKEN',
|
931 |
|
932 | maxContentLength: -1,
|
933 | maxBodyLength: -1,
|
934 |
|
935 | validateStatus: function validateStatus(status) {
|
936 | return status >= 200 && status < 300;
|
937 | }
|
938 | };
|
939 |
|
940 | defaults.headers = {
|
941 | common: {
|
942 | 'Accept': 'application/json, text/plain, */*'
|
943 | }
|
944 | };
|
945 |
|
946 | utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
947 | defaults.headers[method] = {};
|
948 | });
|
949 |
|
950 | utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
951 | defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
952 | });
|
953 |
|
954 | module.exports = defaults;
|
955 |
|
956 |
|
957 | }),
|
958 |
|
959 | (function(module, exports, __webpack_require__) {
|
960 |
|
961 | 'use strict';
|
962 |
|
963 | var utils = __webpack_require__(2);
|
964 |
|
965 | module.exports = function normalizeHeaderName(headers, normalizedName) {
|
966 | utils.forEach(headers, function processHeader(value, name) {
|
967 | if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
968 | headers[normalizedName] = value;
|
969 | delete headers[name];
|
970 | }
|
971 | });
|
972 | };
|
973 |
|
974 |
|
975 | }),
|
976 |
|
977 | (function(module, exports, __webpack_require__) {
|
978 |
|
979 | 'use strict';
|
980 |
|
981 | var utils = __webpack_require__(2);
|
982 | var settle = __webpack_require__(13);
|
983 | var cookies = __webpack_require__(16);
|
984 | var buildURL = __webpack_require__(5);
|
985 | var buildFullPath = __webpack_require__(17);
|
986 | var parseHeaders = __webpack_require__(20);
|
987 | var isURLSameOrigin = __webpack_require__(21);
|
988 | var createError = __webpack_require__(14);
|
989 |
|
990 | module.exports = function xhrAdapter(config) {
|
991 | return new Promise(function dispatchXhrRequest(resolve, reject) {
|
992 | var requestData = config.data;
|
993 | var requestHeaders = config.headers;
|
994 |
|
995 | if (utils.isFormData(requestData)) {
|
996 | delete requestHeaders['Content-Type'];
|
997 | }
|
998 |
|
999 | var request = new XMLHttpRequest();
|
1000 |
|
1001 |
|
1002 | if (config.auth) {
|
1003 | var username = config.auth.username || '';
|
1004 | var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
1005 | requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
1006 | }
|
1007 |
|
1008 | var fullPath = buildFullPath(config.baseURL, config.url);
|
1009 | request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
1010 |
|
1011 |
|
1012 | request.timeout = config.timeout;
|
1013 |
|
1014 |
|
1015 | request.onreadystatechange = function handleLoad() {
|
1016 | if (!request || request.readyState !== 4) {
|
1017 | return;
|
1018 | }
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 | if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
1025 | return;
|
1026 | }
|
1027 |
|
1028 |
|
1029 | var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
1030 | var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
1031 | var response = {
|
1032 | data: responseData,
|
1033 | status: request.status,
|
1034 | statusText: request.statusText,
|
1035 | headers: responseHeaders,
|
1036 | config: config,
|
1037 | request: request
|
1038 | };
|
1039 |
|
1040 | settle(resolve, reject, response);
|
1041 |
|
1042 |
|
1043 | request = null;
|
1044 | };
|
1045 |
|
1046 |
|
1047 | request.onabort = function handleAbort() {
|
1048 | if (!request) {
|
1049 | return;
|
1050 | }
|
1051 |
|
1052 | reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
1053 |
|
1054 |
|
1055 | request = null;
|
1056 | };
|
1057 |
|
1058 |
|
1059 | request.onerror = function handleError() {
|
1060 |
|
1061 |
|
1062 | reject(createError('Network Error', config, null, request));
|
1063 |
|
1064 |
|
1065 | request = null;
|
1066 | };
|
1067 |
|
1068 |
|
1069 | request.ontimeout = function handleTimeout() {
|
1070 | var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
1071 | if (config.timeoutErrorMessage) {
|
1072 | timeoutErrorMessage = config.timeoutErrorMessage;
|
1073 | }
|
1074 | reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
|
1075 | request));
|
1076 |
|
1077 |
|
1078 | request = null;
|
1079 | };
|
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 | if (utils.isStandardBrowserEnv()) {
|
1085 |
|
1086 | var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
1087 | cookies.read(config.xsrfCookieName) :
|
1088 | undefined;
|
1089 |
|
1090 | if (xsrfValue) {
|
1091 | requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
1092 | }
|
1093 | }
|
1094 |
|
1095 |
|
1096 | if ('setRequestHeader' in request) {
|
1097 | utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
1098 | if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
1099 |
|
1100 | delete requestHeaders[key];
|
1101 | } else {
|
1102 |
|
1103 | request.setRequestHeader(key, val);
|
1104 | }
|
1105 | });
|
1106 | }
|
1107 |
|
1108 |
|
1109 | if (!utils.isUndefined(config.withCredentials)) {
|
1110 | request.withCredentials = !!config.withCredentials;
|
1111 | }
|
1112 |
|
1113 |
|
1114 | if (config.responseType) {
|
1115 | try {
|
1116 | request.responseType = config.responseType;
|
1117 | } catch (e) {
|
1118 |
|
1119 |
|
1120 | if (config.responseType !== 'json') {
|
1121 | throw e;
|
1122 | }
|
1123 | }
|
1124 | }
|
1125 |
|
1126 |
|
1127 | if (typeof config.onDownloadProgress === 'function') {
|
1128 | request.addEventListener('progress', config.onDownloadProgress);
|
1129 | }
|
1130 |
|
1131 |
|
1132 | if (typeof config.onUploadProgress === 'function' && request.upload) {
|
1133 | request.upload.addEventListener('progress', config.onUploadProgress);
|
1134 | }
|
1135 |
|
1136 | if (config.cancelToken) {
|
1137 |
|
1138 | config.cancelToken.promise.then(function onCanceled(cancel) {
|
1139 | if (!request) {
|
1140 | return;
|
1141 | }
|
1142 |
|
1143 | request.abort();
|
1144 | reject(cancel);
|
1145 |
|
1146 | request = null;
|
1147 | });
|
1148 | }
|
1149 |
|
1150 | if (!requestData) {
|
1151 | requestData = null;
|
1152 | }
|
1153 |
|
1154 |
|
1155 | request.send(requestData);
|
1156 | });
|
1157 | };
|
1158 |
|
1159 |
|
1160 | }),
|
1161 |
|
1162 | (function(module, exports, __webpack_require__) {
|
1163 |
|
1164 | 'use strict';
|
1165 |
|
1166 | var createError = __webpack_require__(14);
|
1167 |
|
1168 | |
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 | module.exports = function settle(resolve, reject, response) {
|
1176 | var validateStatus = response.config.validateStatus;
|
1177 | if (!response.status || !validateStatus || validateStatus(response.status)) {
|
1178 | resolve(response);
|
1179 | } else {
|
1180 | reject(createError(
|
1181 | 'Request failed with status code ' + response.status,
|
1182 | response.config,
|
1183 | null,
|
1184 | response.request,
|
1185 | response
|
1186 | ));
|
1187 | }
|
1188 | };
|
1189 |
|
1190 |
|
1191 | }),
|
1192 |
|
1193 | (function(module, exports, __webpack_require__) {
|
1194 |
|
1195 | 'use strict';
|
1196 |
|
1197 | var enhanceError = __webpack_require__(15);
|
1198 |
|
1199 | |
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 | module.exports = function createError(message, config, code, request, response) {
|
1210 | var error = new Error(message);
|
1211 | return enhanceError(error, config, code, request, response);
|
1212 | };
|
1213 |
|
1214 |
|
1215 | }),
|
1216 |
|
1217 | (function(module, exports) {
|
1218 |
|
1219 | 'use strict';
|
1220 |
|
1221 | |
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 | module.exports = function enhanceError(error, config, code, request, response) {
|
1232 | error.config = config;
|
1233 | if (code) {
|
1234 | error.code = code;
|
1235 | }
|
1236 |
|
1237 | error.request = request;
|
1238 | error.response = response;
|
1239 | error.isAxiosError = true;
|
1240 |
|
1241 | error.toJSON = function toJSON() {
|
1242 | return {
|
1243 |
|
1244 | message: this.message,
|
1245 | name: this.name,
|
1246 |
|
1247 | description: this.description,
|
1248 | number: this.number,
|
1249 |
|
1250 | fileName: this.fileName,
|
1251 | lineNumber: this.lineNumber,
|
1252 | columnNumber: this.columnNumber,
|
1253 | stack: this.stack,
|
1254 |
|
1255 | config: this.config,
|
1256 | code: this.code
|
1257 | };
|
1258 | };
|
1259 | return error;
|
1260 | };
|
1261 |
|
1262 |
|
1263 | }),
|
1264 |
|
1265 | (function(module, exports, __webpack_require__) {
|
1266 |
|
1267 | 'use strict';
|
1268 |
|
1269 | var utils = __webpack_require__(2);
|
1270 |
|
1271 | module.exports = (
|
1272 | utils.isStandardBrowserEnv() ?
|
1273 |
|
1274 |
|
1275 | (function standardBrowserEnv() {
|
1276 | return {
|
1277 | write: function write(name, value, expires, path, domain, secure) {
|
1278 | var cookie = [];
|
1279 | cookie.push(name + '=' + encodeURIComponent(value));
|
1280 |
|
1281 | if (utils.isNumber(expires)) {
|
1282 | cookie.push('expires=' + new Date(expires).toGMTString());
|
1283 | }
|
1284 |
|
1285 | if (utils.isString(path)) {
|
1286 | cookie.push('path=' + path);
|
1287 | }
|
1288 |
|
1289 | if (utils.isString(domain)) {
|
1290 | cookie.push('domain=' + domain);
|
1291 | }
|
1292 |
|
1293 | if (secure === true) {
|
1294 | cookie.push('secure');
|
1295 | }
|
1296 |
|
1297 | document.cookie = cookie.join('; ');
|
1298 | },
|
1299 |
|
1300 | read: function read(name) {
|
1301 | var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
1302 | return (match ? decodeURIComponent(match[3]) : null);
|
1303 | },
|
1304 |
|
1305 | remove: function remove(name) {
|
1306 | this.write(name, '', Date.now() - 86400000);
|
1307 | }
|
1308 | };
|
1309 | })() :
|
1310 |
|
1311 |
|
1312 | (function nonStandardBrowserEnv() {
|
1313 | return {
|
1314 | write: function write() {},
|
1315 | read: function read() { return null; },
|
1316 | remove: function remove() {}
|
1317 | };
|
1318 | })()
|
1319 | );
|
1320 |
|
1321 |
|
1322 | }),
|
1323 |
|
1324 | (function(module, exports, __webpack_require__) {
|
1325 |
|
1326 | 'use strict';
|
1327 |
|
1328 | var isAbsoluteURL = __webpack_require__(18);
|
1329 | var combineURLs = __webpack_require__(19);
|
1330 |
|
1331 | |
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 | module.exports = function buildFullPath(baseURL, requestedURL) {
|
1341 | if (baseURL && !isAbsoluteURL(requestedURL)) {
|
1342 | return combineURLs(baseURL, requestedURL);
|
1343 | }
|
1344 | return requestedURL;
|
1345 | };
|
1346 |
|
1347 |
|
1348 | }),
|
1349 |
|
1350 | (function(module, exports) {
|
1351 |
|
1352 | 'use strict';
|
1353 |
|
1354 | |
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | module.exports = function isAbsoluteURL(url) {
|
1361 |
|
1362 |
|
1363 |
|
1364 | return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
1365 | };
|
1366 |
|
1367 |
|
1368 | }),
|
1369 |
|
1370 | (function(module, exports) {
|
1371 |
|
1372 | 'use strict';
|
1373 |
|
1374 | |
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 |
|
1381 | module.exports = function combineURLs(baseURL, relativeURL) {
|
1382 | return relativeURL
|
1383 | ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
1384 | : baseURL;
|
1385 | };
|
1386 |
|
1387 |
|
1388 | }),
|
1389 |
|
1390 | (function(module, exports, __webpack_require__) {
|
1391 |
|
1392 | 'use strict';
|
1393 |
|
1394 | var utils = __webpack_require__(2);
|
1395 |
|
1396 |
|
1397 |
|
1398 | var ignoreDuplicateOf = [
|
1399 | 'age', 'authorization', 'content-length', 'content-type', 'etag',
|
1400 | 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
1401 | 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
1402 | 'referer', 'retry-after', 'user-agent'
|
1403 | ];
|
1404 |
|
1405 | |
1406 |
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 | module.exports = function parseHeaders(headers) {
|
1419 | var parsed = {};
|
1420 | var key;
|
1421 | var val;
|
1422 | var i;
|
1423 |
|
1424 | if (!headers) { return parsed; }
|
1425 |
|
1426 | utils.forEach(headers.split('\n'), function parser(line) {
|
1427 | i = line.indexOf(':');
|
1428 | key = utils.trim(line.substr(0, i)).toLowerCase();
|
1429 | val = utils.trim(line.substr(i + 1));
|
1430 |
|
1431 | if (key) {
|
1432 | if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
1433 | return;
|
1434 | }
|
1435 | if (key === 'set-cookie') {
|
1436 | parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
1437 | } else {
|
1438 | parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
1439 | }
|
1440 | }
|
1441 | });
|
1442 |
|
1443 | return parsed;
|
1444 | };
|
1445 |
|
1446 |
|
1447 | }),
|
1448 |
|
1449 | (function(module, exports, __webpack_require__) {
|
1450 |
|
1451 | 'use strict';
|
1452 |
|
1453 | var utils = __webpack_require__(2);
|
1454 |
|
1455 | module.exports = (
|
1456 | utils.isStandardBrowserEnv() ?
|
1457 |
|
1458 |
|
1459 |
|
1460 | (function standardBrowserEnv() {
|
1461 | var msie = /(msie|trident)/i.test(navigator.userAgent);
|
1462 | var urlParsingNode = document.createElement('a');
|
1463 | var originURL;
|
1464 |
|
1465 | |
1466 |
|
1467 |
|
1468 |
|
1469 |
|
1470 |
|
1471 | function resolveURL(url) {
|
1472 | var href = url;
|
1473 |
|
1474 | if (msie) {
|
1475 |
|
1476 | urlParsingNode.setAttribute('href', href);
|
1477 | href = urlParsingNode.href;
|
1478 | }
|
1479 |
|
1480 | urlParsingNode.setAttribute('href', href);
|
1481 |
|
1482 |
|
1483 | return {
|
1484 | href: urlParsingNode.href,
|
1485 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
1486 | host: urlParsingNode.host,
|
1487 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
1488 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
1489 | hostname: urlParsingNode.hostname,
|
1490 | port: urlParsingNode.port,
|
1491 | pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
1492 | urlParsingNode.pathname :
|
1493 | '/' + urlParsingNode.pathname
|
1494 | };
|
1495 | }
|
1496 |
|
1497 | originURL = resolveURL(window.location.href);
|
1498 |
|
1499 | |
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 |
|
1505 | return function isURLSameOrigin(requestURL) {
|
1506 | var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
1507 | return (parsed.protocol === originURL.protocol &&
|
1508 | parsed.host === originURL.host);
|
1509 | };
|
1510 | })() :
|
1511 |
|
1512 |
|
1513 | (function nonStandardBrowserEnv() {
|
1514 | return function isURLSameOrigin() {
|
1515 | return true;
|
1516 | };
|
1517 | })()
|
1518 | );
|
1519 |
|
1520 |
|
1521 | }),
|
1522 |
|
1523 | (function(module, exports, __webpack_require__) {
|
1524 |
|
1525 | 'use strict';
|
1526 |
|
1527 | var utils = __webpack_require__(2);
|
1528 |
|
1529 | |
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 | module.exports = function mergeConfig(config1, config2) {
|
1538 |
|
1539 | config2 = config2 || {};
|
1540 | var config = {};
|
1541 |
|
1542 | var valueFromConfig2Keys = ['url', 'method', 'data'];
|
1543 | var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
1544 | var defaultToConfig2Keys = [
|
1545 | 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
1546 | 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
1547 | 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
1548 | 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
1549 | 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
1550 | ];
|
1551 | var directMergeKeys = ['validateStatus'];
|
1552 |
|
1553 | function getMergedValue(target, source) {
|
1554 | if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
1555 | return utils.merge(target, source);
|
1556 | } else if (utils.isPlainObject(source)) {
|
1557 | return utils.merge({}, source);
|
1558 | } else if (utils.isArray(source)) {
|
1559 | return source.slice();
|
1560 | }
|
1561 | return source;
|
1562 | }
|
1563 |
|
1564 | function mergeDeepProperties(prop) {
|
1565 | if (!utils.isUndefined(config2[prop])) {
|
1566 | config[prop] = getMergedValue(config1[prop], config2[prop]);
|
1567 | } else if (!utils.isUndefined(config1[prop])) {
|
1568 | config[prop] = getMergedValue(undefined, config1[prop]);
|
1569 | }
|
1570 | }
|
1571 |
|
1572 | utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
1573 | if (!utils.isUndefined(config2[prop])) {
|
1574 | config[prop] = getMergedValue(undefined, config2[prop]);
|
1575 | }
|
1576 | });
|
1577 |
|
1578 | utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
1579 |
|
1580 | utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
1581 | if (!utils.isUndefined(config2[prop])) {
|
1582 | config[prop] = getMergedValue(undefined, config2[prop]);
|
1583 | } else if (!utils.isUndefined(config1[prop])) {
|
1584 | config[prop] = getMergedValue(undefined, config1[prop]);
|
1585 | }
|
1586 | });
|
1587 |
|
1588 | utils.forEach(directMergeKeys, function merge(prop) {
|
1589 | if (prop in config2) {
|
1590 | config[prop] = getMergedValue(config1[prop], config2[prop]);
|
1591 | } else if (prop in config1) {
|
1592 | config[prop] = getMergedValue(undefined, config1[prop]);
|
1593 | }
|
1594 | });
|
1595 |
|
1596 | var axiosKeys = valueFromConfig2Keys
|
1597 | .concat(mergeDeepPropertiesKeys)
|
1598 | .concat(defaultToConfig2Keys)
|
1599 | .concat(directMergeKeys);
|
1600 |
|
1601 | var otherKeys = Object
|
1602 | .keys(config1)
|
1603 | .concat(Object.keys(config2))
|
1604 | .filter(function filterAxiosKeys(key) {
|
1605 | return axiosKeys.indexOf(key) === -1;
|
1606 | });
|
1607 |
|
1608 | utils.forEach(otherKeys, mergeDeepProperties);
|
1609 |
|
1610 | return config;
|
1611 | };
|
1612 |
|
1613 |
|
1614 | }),
|
1615 |
|
1616 | (function(module, exports) {
|
1617 |
|
1618 | 'use strict';
|
1619 |
|
1620 | |
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 | function Cancel(message) {
|
1627 | this.message = message;
|
1628 | }
|
1629 |
|
1630 | Cancel.prototype.toString = function toString() {
|
1631 | return 'Cancel' + (this.message ? ': ' + this.message : '');
|
1632 | };
|
1633 |
|
1634 | Cancel.prototype.__CANCEL__ = true;
|
1635 |
|
1636 | module.exports = Cancel;
|
1637 |
|
1638 |
|
1639 | }),
|
1640 |
|
1641 | (function(module, exports, __webpack_require__) {
|
1642 |
|
1643 | 'use strict';
|
1644 |
|
1645 | var Cancel = __webpack_require__(23);
|
1646 |
|
1647 | |
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 | function CancelToken(executor) {
|
1654 | if (typeof executor !== 'function') {
|
1655 | throw new TypeError('executor must be a function.');
|
1656 | }
|
1657 |
|
1658 | var resolvePromise;
|
1659 | this.promise = new Promise(function promiseExecutor(resolve) {
|
1660 | resolvePromise = resolve;
|
1661 | });
|
1662 |
|
1663 | var token = this;
|
1664 | executor(function cancel(message) {
|
1665 | if (token.reason) {
|
1666 |
|
1667 | return;
|
1668 | }
|
1669 |
|
1670 | token.reason = new Cancel(message);
|
1671 | resolvePromise(token.reason);
|
1672 | });
|
1673 | }
|
1674 |
|
1675 | |
1676 |
|
1677 |
|
1678 | CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
1679 | if (this.reason) {
|
1680 | throw this.reason;
|
1681 | }
|
1682 | };
|
1683 |
|
1684 | |
1685 |
|
1686 |
|
1687 |
|
1688 | CancelToken.source = function source() {
|
1689 | var cancel;
|
1690 | var token = new CancelToken(function executor(c) {
|
1691 | cancel = c;
|
1692 | });
|
1693 | return {
|
1694 | token: token,
|
1695 | cancel: cancel
|
1696 | };
|
1697 | };
|
1698 |
|
1699 | module.exports = CancelToken;
|
1700 |
|
1701 |
|
1702 | }),
|
1703 |
|
1704 | (function(module, exports) {
|
1705 |
|
1706 | 'use strict';
|
1707 |
|
1708 | |
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 | module.exports = function spread(callback) {
|
1729 | return function wrap(arr) {
|
1730 | return callback.apply(null, arr);
|
1731 | };
|
1732 | };
|
1733 |
|
1734 |
|
1735 | }),
|
1736 |
|
1737 | (function(module, exports) {
|
1738 |
|
1739 | 'use strict';
|
1740 |
|
1741 | |
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 | module.exports = function isAxiosError(payload) {
|
1748 | return (typeof payload === 'object') && (payload.isAxiosError === true);
|
1749 | };
|
1750 |
|
1751 |
|
1752 | })
|
1753 | ])
|
1754 | });
|
1755 | ;
|
1756 |
|
\ | No newline at end of file |