随笔分类 - axiso
摘要:查看源码我们发现axios的几种请求方式都是调用request方法,下面一步步分析下。 Axios.prototype.request = function request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow
阅读全文
摘要:axios有两种中断请求的方法 1.CancelToken.source 取消所有请求 const CancelToken = axios.CancelToken; const source = CancelToken.source(); axios.post('/test', { value: '
阅读全文
摘要:一.forEach function forEach(obj, fn) { // Don't bother if no value provided if (obj null || typeof obj 'undefined') { return; } // Force an array if no
阅读全文