axiosinstance update last request response code example
Example 1: AXIOS CDN
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
Example 2: axios.interceptors.response.use
// Add a response interceptor
HTTP.interceptors.response.use(function (response) {
return response
}, function(error) {
if (error.response.status === 401) {
store.dispatch('logout')
router.push('/login')
}
return Promise.reject(error.response.data)
})