美文网首页
vue的请求拦截器

vue的请求拦截器

作者: 最念倾城 | 来源:发表于2021-02-03 10:27 被阅读0次

https://github.com/axios/axios下面的

Interceptors
You can intercept requests or responses before they are handled by then or catch.

// Add a request interceptor
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    return config;
  }, function (error) {
    // Do something with request error
    return Promise.reject(error);
  });
image.png

相关文章

网友评论

      本文标题:vue的请求拦截器

      本文链接:https://www.haomeiwen.com/subject/aueptltx.html