您好 请问问题解决了么
wx.request内容有错win7 64位系统,最新版微信开发工具 get请求商品列表,报错,(应该是请求地址被重定向到https://open.weixin.qq.com这里了,因为首先报的错是这个域名没有被授权,我加入到小程序后台之后,才报的下面这个错误)。然后返回这样 "<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"> </head> <body> <script type="text/javascript"> var ua = navigator.userAgent.toLowerCase(); var isWeixin = ua.indexOf('micromessenger') != -1; var isAndroid = ua.indexOf('android') != -1; var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1); if (!isWeixin) { document.head.innerHTML = '<title>抱歉,出错了</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"><link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css">'; document.body.innerHTML = '<div class="weui_msg"><div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div><div class="weui_text_area"><h4 class="weui_msg_title">请在微信客户端打开链接</h4></div></div>'; } </script> </body> </html> ", 我的请求地址直接在浏览器输入时可以返回正常json格式数据的。 (我的商城网站原本是在公众号里面的,用基于微擎开发的商城。现在要做小程序,我就在原来代码后台写了几个用于返回数据的接口来供小程序调用,但是就出现这种情况。但是我用3月份的一个微信开发者工具来开发时是可以正常返回数据的,不过不能在手机预览,只能在开发工具中成功返回) 请问这个问题是什么原因导致的?该怎么解决?
2018-10-24您好,请问这个问题解决了么
wx.request 访问所有URL都返回相同数据域名已加入白名单, TLS版本也是支撑的, 1.0, 1.1, 1.2 模拟器打开没有问题, 真机打开变这样? 多个真机都试过了 [图片] 远程调试结果: [图片] URL明显是我自己的, 但是获取的数据是微信的???? 有大神遇到过吗. 调试了2天了. 找不到原因 这是获取的代码: [代码] [代码] [代码]<[代码][代码]html[代码][代码]> [代码] [代码]<[代码][代码]head[代码][代码]> [代码] [代码]<[代码][代码]meta[代码] [代码]name[代码][代码]=[代码][代码]"viewport"[代码] [代码]content[代码][代码]=[代码][代码]"width=device-width, initial-scale=1, user-scalable=0"[代码][代码]> [代码] [代码][代码]head[代码][代码]> [代码][代码] [代码][代码]<[代码][代码]body[代码][代码]> [代码][代码] [代码][代码]<[代码][代码]script[代码] [代码]type[代码][代码]=[代码][代码]"text/javascript"[代码][代码]> [代码][代码] [代码][代码]var ua = navigator.userAgent.toLowerCase(); [代码][代码] [代码][代码] var isWeixin = ua.indexOf('micromessenger') != -1; [代码][代码] [代码][代码] var isAndroid = ua.indexOf('android') != -1; [代码][代码] [代码][代码]var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1); [代码][代码] [代码][代码]if (!isWeixin) { [代码][代码] [代码][代码] document.head.innerHTML = '<[代码][代码]title[代码][代码]>��Ǹ�������[代码]title[代码][代码]>[代码][代码][代码] [代码][代码][代码]<[代码][代码]meta[代码] [代码]charset[代码][代码]=[代码][代码]"utf-8"[代码][代码]>[代码][代码][代码] [代码][代码][代码]<[代码][代码]meta[代码] [代码]name[代码][代码]=[代码][代码]"viewport"[代码] [代码]content[代码][代码]=[代码][代码]"width=device-width, initial-scale=1, user-scalable=0"[代码][代码]>[代码][代码][代码] [代码][代码][代码]<[代码][代码]link[代码] [代码]rel[代码][代码]=[代码][代码]"stylesheet"[代码] [代码]type[代码][代码]=[代码][代码]"text/css"[代码] [代码]href[代码][代码]=[代码][代码]"https://res.wx.qq.com/open/libs/weui/0.4.1/weui.css"[代码][代码]>'; [代码][代码][代码] [代码][代码][代码]document.body.innerHTML = '<[代码][代码]div[代码] [代码]class[代码][代码]=[代码][代码]"weui_msg"[代码][代码]>[代码][代码][代码] [代码][代码][代码]<[代码][代码]div[代码] [代码]class[代码][代码]=[代码][代码]"weui_icon_area"[代码][代码]><[代码][代码]i[代码] [代码]class[代码][代码]=[代码][代码]"weui_icon_info weui_icon_msg"[代码][代码]>[代码]i[代码][代码]>[代码]div[代码][代码]>[代码][代码][代码][代码][代码] [代码][代码][代码]<[代码][代码]div[代码] [代码]class[代码][代码]=[代码][代码]"weui_text_area"[代码][代码]><[代码][代码]h4[代码] [代码]class[代码][代码]=[代码][代码]"weui_msg_title"[代码][代码]>�����ſͻ��˴�t��[代码]h4[代码][代码]>[代码]div[代码][代码]>[代码]div[代码][代码]>'; } [代码][代码][代码][代码][代码][代码] [代码][代码][代码][代码]script[代码][代码]> [代码][代码][代码][代码] [代码][代码][代码][代码]body[代码][代码]>[代码][代码][代码][代码] [代码][代码][代码] [代码]html[代码][代码]>[代码][代码][代码][代码]
2018-10-24