如何在Axios中处理net :: ERR_CONNECTION_REFUSED-Vue.js - SamYoc 有壳
https://www.samyoc.com/single/4016
您可以使用拦截器:
代码语言:javascript复制axios.interceptors.response.use(
response => {
return response
},
error => {
if (!error.response) {
console.log("Please check your internet connection.");
}
return Promise.reject(error)
}
)