当后端api应用程序不工作或未启动时,在浏览器控制台会收到以下错误。
OPTIONS http://127.0.0.1:3000/api/user_token net::ERR_CONNECTION_REFUSED
如何处理这个错误?
发布于 2020-01-16 05:20:59
axios.get(url, oprtions)
.then((response) => console.log(response))
.catch((error) => console.log(error)); // error.response, error.response.status, and so on
或
fetch(url, oprtions)
.then((response) => console.log(response))
.catch((error) => console.log(error)); // error.response, error.response.status, and so on
阅读有关错误处理的更多信息:
https://stackoverflow.com/questions/59758485
复制相似问题