Closed gyamxxx closed 7 years ago
+1
You can use interceptors
// Add a request interceptor
axios.interceptors.request.use(function (config) {
// Do something before request is sent
NProgress.start();
return config;
}, function (error) {
// Do something with request error
console.error(error)
return Promise.reject(error);
});
// Add a response interceptor
axios.interceptors.response.use(function (response) {
// Do something with response data
NProgress.done();
return response;
}, function (error) {
// Do something with response error
console.error(error)
return Promise.reject(error);
});
Hi @gyamxxx , sorry for replying so late....too busy with personal affairs these days. What @bigggge said is exactly correct. And I will update the vue-admin with Axios recently as a demo for this issue.
Thanks guys!
Retiring vue-resource https://medium.com/the-vue-point/retiring-vue-resource-871a82880af4#.9oiug628f
so, could u support axios on option.http ?