Home  >  Q&A  >  body text

node.js - 微信小程序真机测试时,wx.request请求没有返回结果

今天把做完的小程序打算与生产服务器联调,所以就把小程序的request的合法域名设置好,

https://wxss.xxxx.com

设置完之后就先在本地做了一下测试。一切正常,请求发出,后端也接收正常,并且正常返回json数据

然后准备预览真机测试一下,但是到真机上就郁闷。无法接收到服务器的返回结果,只要是需要request请求,都无法执行。

我就打开真机的调试功能,也没有把报错。

看是看到打印了一个日志 " request begin " 然后就没下文了。。。。。 我这个郁闷。完全不知道是什么问题引起的。

后台的也没有打印任何东西,根本就是没有接收到请求。

请各位大神帮忙看看是什么原因?

我自己猜测会不会跟我的免费证书有关系?

怪我咯怪我咯2716 days ago821

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 16:05:18

    This problem has been solved, my problem is mainly the third one

    1. The legal domain name set cannot have a port number. The default port number of HTTPS is 443. You cannot change it to another one, you can only use the default port
    2. TLS only supports version 1.2 and above
    3. The generated SSL certificate must be correct

    Attached is a method to obtain the Alibaba Cloud certificate https://segmentfault.com/n/13...

    reply
    0
  • 阿神

    阿神2017-04-17 16:05:18

    Has the interface domain name been configured in the backend of the mini program?

    reply
    0
  • Cancelreply