Open julurivinay opened 4 years ago
I want to write a logic after the retry count completed. In axios interceptor i need to write logic for it or do we have any other option for it.
My axios interceptor code looks below const axiosGlobalConfig = function () {
axios.interceptors.request.use(function (config) { console.log('23232', config);
// let configUrl: any = config.url; // let myRegExp = new RegExp(Config.webServiceUrl, 'i'); // configUrl = configUrl.replace(myRegExp, ''); // config.url = configUrl; // // config.url; config.url = Config.webServiceUrl + config.url; if (localStorage.getItem('accessToken')) { config.headers.Authorization = 'Bearer ' + localStorage.getItem('accessToken'); config.headers.refreshToken = localStorage.getItem('refreshToken'); } return config; }, function (error) { }); axios.interceptors.response.use(function (response) { return response; }, function (error) { // console.log('error123', error); if (error.response == undefined) { // console.log('error123', error); i = i + 1; if(i == 3) { alert(i) } }
+1 it would be a great feature ;)
any update on this?
have a look at #199
I want to write a logic after the retry count completed. In axios interceptor i need to write logic for it or do we have any other option for it.
My axios interceptor code looks below const axiosGlobalConfig = function () {
axios.interceptors.request.use(function (config) { console.log('23232', config);