JavaScript/vue.js/error:修订间差异
来自康健生活
| 第62行: | 第62行: | ||
*: axios在部分手机的微信浏览器中无法发起请求 | *: axios在部分手机的微信浏览器中无法发起请求 | ||
*: 尝试解决给服务器添加目标网站 host,这个问题确切说不是手机浏览器不能发送请求,而是手机本地没有设置代理(电脑开发机通过修改 /etc/hosts 可以发送请求)。 | *: 尝试解决给服务器添加目标网站 host,这个问题确切说不是手机浏览器不能发送请求,而是手机本地没有设置代理(电脑开发机通过修改 /etc/hosts 可以发送请求)。 | ||
* 手机端浏览器 Uncaught (in promise) Error: Network Error | |||
*: 先确定问题在哪里 | |||
*: {{hc|footer.vue|<syntaxhighlight lang="javascript" highlight='3-5'> | |||
axios.get('/disease/footer_recommend').then((req) => { | |||
_self.Disease_footer_recommend = req.data.data; | |||
}) | |||
});</syntaxhighlight>|<syntaxhighlight lang="javascript" highlight='3-5'>axios.get('/disease/footer_recommend').then((req) => { | |||
_self.Disease_footer_recommend = req.data.data; | |||
}).catch((error)=>{ | |||
console.log(error); | |||
_self.errorMessage = error; | |||
});</syntaxhighlight>}} | |||