Javascript 当后端API应用程序未运行时,如何处理Vue JS应用程序?
当后端api应用程序不工作或未启动时,将在浏览器控制台中收到以下错误Javascript 当后端API应用程序未运行时,如何处理Vue JS应用程序?,javascript,vue.js,error-handling,Javascript,Vue.js,Error Handling,当后端api应用程序不工作或未启动时,将在浏览器控制台中收到以下错误 OPTIONS http://127.0.0.1:3000/api/user_token net::ERR_CONNECTION_REFUSED 如何处理这个错误 axios.get(url, oprtions) .then((response) => console.log(response)) .catch((error) => console.log(error)); // error.respon
OPTIONS http://127.0.0.1:3000/api/user_token net::ERR_CONNECTION_REFUSED
如何处理这个错误
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