GithubHelp home page GithubHelp logo

varletjs / axle Goto Github PK

View Code? Open in Web Editor NEW
102.0 102.0 11.0 1.23 MB

Progressive request tool based on axios.

License: MIT License

HTML 0.81% JavaScript 5.04% Vue 15.90% TypeScript 78.24%
axios axle http varlet

axle's People

Contributors

a145789 avatar aybrea avatar chouchouji avatar gaoting avatar haoziqaq avatar qytayh avatar zhangmo8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axle's Issues

responseStatusInterceptor 执行顺序非预期

axle请求 外层status 200
但是内层data为 {code: 401}
responseStatusInterceptor 只会执行validStatusHandler
invalidStatusHandler配置的401选项不会执行
表现上看起来就是 无论服务器返回什么(不局限于401 501 403),axle的状态始终是200,
导致始终会进validStatusHandler的逻辑

关于拦截器使用后类型未更新的问题

useResponseInterceptor(responseStatusInterceptor({
 200: (res) => {
            return res.data; // 成功的状态码
        },
...
..

使用上述拦截器将第一层data返回后

const res = axle.get(...)

res还是还是AlxeRespons类型,没有跟拦截器返回的类型进行绑定

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.