1.0.0 • Published 1 year ago

cs-axios-plus v1.0.0

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

install

npm i CH-axios

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

const {data,loading,status} = new Axios()

1.0.0

1 year ago