Skip to content

Files

Latest commit

 

History

History
12 lines (7 loc) · 347 Bytes

intercepter.md

File metadata and controls

12 lines (7 loc) · 347 Bytes

拦截器配置

angular也可以向后台配置拦截器一样, 拦截所以http请求。

比如你每个请求都有增加token,就可以配置在拦截器中。

不会用可以参考这里

https://angular.cn/guide/http#拦截所有的请求和响应。

参考实现代码src/app/auto-intercepter.ts