【发布时间】:2019-06-09 17:25:56
【问题描述】:
我在安装在 Vue 应用程序中调用此代码
mounted() {
this.isMounted = true;
axios.get('https://randomuser.me/api/').then((response) => {
console.log("Response is" + response)
}).catch(function(error) {
// handle error
console.log("Error is: " + error);
})
}
并且总是得到相同的错误:错误:请求失败,状态码为 404
我已经测试过 API 并且运行良好,总是以 200 响应。 我不知道我做错了什么
【问题讨论】:
-
你确定是https吗?
-
是的,它的 https,问题是 MockAdapter
标签: vue.js promise vuejs2 axios