axios.get(path, {
timeout: 1000,
params: {
id: 12
}
});
repeatedly checked, backend 3 seconds to respond, I set axios 1 second timeout, but axios has not entered the catch, how fat 4?
axios.get(path, {
timeout: 1000,
params: {
id: 12
}
});
repeatedly checked, backend 3 seconds to respond, I set axios 1 second timeout, but axios has not entered the catch, how fat 4?
found some clues on StackOverflow, needs to create an Axios instance
try to update JsFiddle, and it works
https://jsfiddle.net/Les41a0c/2/
axiosVueVue.prototype.axios = axios
import Vue from 'vue'
import App from './App'
//axios
Vue.prototype.axios = axiso;
axios.interceptors.response.use()
axios.get(path,params,{timeout: 1000});
//
Previous: Vue.js store prompts Cannot read property 'commit' of undefined
Next: The deep copy of typescript is stuck in an endless loop, how to modify the code? Solve it! Thank you