真机调试wx.request失败,无响应?

小程序 文章 2022-02-28 15:00 2185 0 全屏看文

AI助手支持GPT4.0

真机调试wx.request失败,无响应?Real machine debugging wx.request failed, no response?

真机调试wx.request失败,无响应?

1、已在小程序后台配置好了服务器域名。

2、服务器域名已经部署SSL证书。且SSL证书是443端口,且TLS目前是1.3,且域名已经ICP备案可查。

用postman和浏览器可访问https://xx.com/apixx/xx,全都正常。传参及返回都正常,在微信小程序开发工具内的模拟器内也一切正常,所有接口、数据、流程全都没问题。

现在开发工具内一切正常,在开发工具内把“不校验域名、SSL、TLS”的勾去掉,也没有问题。

3、只有一点特殊,服务器域名是裸域名。一般是https://www.xx.com,目前这个是https://xx.com


现在开发工具内一切正常,在开发工具内把“不校验域名、SSL、TLS”的勾去掉,也没有问题。

但目前使用真机调试、以及预览,wx.request无响应!!

目前用到了百度地图的接口,把百度地图的接口域名放到小程序后台的服务器域名,在真机调试下是可以调用。

目前怀疑是SSL证书,或者裸域名会不会有什么影响???请问哪位大神帮忙看看。另外有没有用过裸域名的朋友??裸域名有影响吗?

1. The server domain name has been configured in the applet background. 2. The server domain name has already deployed SSL certificate. The SSL certificate is port 443, the TLS is currently 1.3, and the domain name has been recorded in ICP. Accessible with postman and browser https://xx.com/apixx/xx , all normal. The transmission, participation and return are normal, and everything is normal in the simulator in the wechat applet development tool. All interfaces, data and processes are OK. Now everything is normal in the development tool. There is no problem removing the check box of "do not verify domain name, SSL and TLS" in the development tool. 3. There is only one special point. The server domain name is a bare domain name. Generally https://www.xx.com , this is https://xx.com Now everything is normal in the development tool. There is no problem removing the check box of "do not verify domain name, SSL and TLS" in the development tool. But at present, real machine debugging and preview are used, Wx No response to request!! At present, the interface of Baidu map is used. Put the interface domain name of Baidu map into the server domain name in the background of the applet, which can be called under real machine debugging. At present, it is suspected that SSL certificate or bare domain name will have any impact??? May I ask which God can help you. Have you ever used another domain name?? Does the naked domain name have an impact?

回答:

VBit:

真机调试,连电脑,wx.request 有错误返回吗

熊勇_Mass(承接软件项目):真机调试,连电脑,电脑端出现联调界面,但电脑端也是无返回。
VBit:network 请求发出去来吗
熊勇_Mass(承接软件项目):发出去了。我发一个视频吧,看能不能上传。
圣殿骑士:

勾选这个后,也不能调吗?

若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人

熊勇_Mass(承接软件项目):勾选 之后也不能调,就很奇怪,并且是两个开发人员两台不同的电脑都试过了。感谢回复
熊勇_Mass(承接软件项目):同一个微信小程序开发工具下,别的微信小程序项目都没问题的。
微喵网络:

互联网基础知识:xx.com和www.xx.com不是同一个域名

熊勇_Mass(承接软件项目):这个当然知道。目前小程序后台服务器域名配置的就是https://xx.com。小程序wx.request请求的也是https://xx.com。不可能犯这种低级错误。且在开发工具里是可以正常访问的,postman也可以。感谢回复

-EOF-

AI助手支持GPT4.0