1.1.5 • Published 1 year ago

hc-axios-plus v1.1.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

install

npm i hc-axios-plus

what this?

  • 为什么二次封装axios
    1. data structure is best simple
    2. error hint is best simple, it will close consoleLog in production
    3. loading: request to be true, response and error to be false
  • config
    • baseURL:baseURL
    • TOKEN:请求头携带的,需要从localstory取出来的TOKEN的名字。
    • isShowErr:触发常用错误码返回对应信息。
    • isCancelRequest:A请求若在请求中,禁止A请求的重复请求。
  • 默认配置

Example

let useAPI = new useAxios();

let { data, loading, status } = await useAPI.get(
"/m2/1455652-0-default/34515570",
{
    ID: 12345,
}
);

console.log(data, loading, status);

Result

e


1.1.5

1 year ago

1.1.4

1 year ago