jia-axios-utils
v0.0.4
Published
```
Downloads
1
Readme
/** *
*
* 1. 接口并发限制(限制同一时间只能有N个请求)
* 2. 接口并发处理(同一时间有一个以上的相同请求, 注:A1,A2 相同请求阻止A2请求)
* 3. mock数据
*
** */
import Require, { RequestUtils } from "jia-axios-utils";
const http = Require({
baseUrl: "http://127.0.0.1:8888",
error(res, cancel) {
if (res.response?.status === 401) {
cancel.call(cancel);
}
},
});
const testApi = function () {
return http({
url: "/one",
});
};
const testApi2 = function () {
return http({
url: "/two",
});
};
testApi2();
testApi();