0.0.4 • Published 2 years ago

jia-axios-utils v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
/** *
 *
 * 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();
0.0.3

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

3 years ago