axios对请求进行拦截时报错:Cannot read property 'cancelToken' of undefined

错误截图:

 

错误原因:

在使用axios的拦截器时,没有添加返回值  return  config

解决方法:

在请求拦截器中添加 return config

 

posted @ 2021-07-16 17:28  前端小白加油  阅读(264)  评论(0)    收藏  举报