vue的请求拦截器

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的请求拦截器)