wx.request为何没有任何响应?

小程序 文章 2020-08-20 10:01 693 0 全屏看文

AI助手支持GPT4.0

wx.request为何没有任何响应?Why is there no response from wx.request?

wx.request为何没有任何响应?

开发者工具1.0.3.2008182

微信为7.0.17 华为安卓

在开发工具里面真机调试wx.request没有任何问题。但是预览,wx.request卡死,设置timeout后,既不进入success、也不进入fail和complete。给了一个wx.showLoading就一直显示加载。

还有一个问题就是在手机端,不用真机调试,如何进行简单调试?只能用wx.showToast吗?

Developer tool 1.0.3.2008182 wechat is 7.0.17. Huawei Android is debugged in the development tool wx.request There is no problem. But preview, wx.request If it is stuck, after setting the timeout, it will neither enter success nor fail or complete. Gave one wx.showLoading Load is always displayed. There is also a problem is in the mobile phone end, do not use the real machine debugging, how to carry out simple debugging? Can only use wx.showToast Is that right?

回答:

田迪:

小程序打开调制宽窗口,再进去试试

Admin²⁰²⁰:

建议直接亮代码吧。

目测可能的原因

1、域名真机上访问有问题,会卡

2、在request前就有js代码出错导致request没执行。


还有一个问题就是在手机端,不用真机调试,如何进行简单调试?只能用wx.showToast吗?

可以vconsole模式,查看打印日志。

皇儒:1.手机上用浏览器访问域名没有问题;2.request前面就是一个showToast代码,这个显示了。
我试试vconsole
皇儒:

感谢各位,已经解决。主要是:1.使用vconsole调试;2.出现这种情况的原因是变量前面没加let,报错变量未定义(python写多了。)谢谢各位。

-EOF-

AI助手支持GPT4.0