同问。
测试号调试网页授权获取用户基本信息,设置user-agent仍然返回错误“请在微信客户端打得开”?测试号appid:wx54b420ff62214172。 程序中: String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx54b420ff62214172&redirect_uri=" +redirectUri+"&response_type=code&scope=snsapi_base&state=123#wechat_redirect"; HttpClient httpclient = HttpClients.createDefault(); HttpGet httpGet = new HttpGet(url); httpGet.setHeader("User-Agent","Mozilla/5.0 (Linux; U; Android 2.3.6; zh-cn; GT-S5660 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MicroMessenger/4.5.255"); 返回的response: <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>
2021-07-15请问解决了吗?
iframe 网页授权 获取 code 提示“请在微信客户端打开链接” ?iframe 网页授权 获取 code 提示“请在微信客户端打开链接” 微信网页开发 - 网页授权 - 静默授权 - 获取code 1、单独 一个页面 getcode.php 自动跳转到 https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect 则 处理正常 ,能返回到 回调页面,也有 code参数,成功。 2、需要把 getcode.php嵌入到 iframe 中,就不正常,提示不是 微信客户端,如图 [图片] [图片] 微信浏览器 是不是不支持 ifame 嵌入 网页授权 获取 code ? 该怎么解决?
2021-07-15我也遇到同样的问题,后台服务接口内部调用https://open.weixin.qq.com/connect/oauth2/authorize授权接口,就返回 请在微信客户端打开链接 这样的一个结果。
电脑版微信网页授权提示请在微信客户端打开链接?访问以下链接会跳转到公众号授权,手机版微信可以正常访问,mac版微信也可以正常,在window版微信上会跳转到白屏页面 https://jyzy.fzzqcdn.com/s/articledata/ARTICLE15888939130811?isshare=true&pid=74cefab8-8217-4acf-88ca-b23a05d55fda&pidUserId=liwei16&ubrUuid=2ebf6c2c-0f1c-45cb-8402-eba6d658d41b&ubrSourceRefid=liwei16 查看页面源代码,里面显示”请在微信客户端打开链接“ https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx05924e5e43f814a9&response_type=code&scope=snsapi_userinfo&connect_redirect=1&state=5f77fe439f2b4809b273510c700f7ebb&redirect_uri=https://weixin.foundersc.com/wx/rewrite/nosilence?nextUrl=https%3A%2F%2Fjyzy.fzzqcdn.com%2FfaTools%2Fh6%2Fwxuserinfo%2Fgreet#wechat_redirect <!DOCTYPE html><html><head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"> <title>WECHAT_EMPTY_TITLE</title><style id="__WXWORK_INNER_SCROLLBAR_CSS">::-webkit-scrollbar { width: 12px !important; height: 12px !important; }::-webkit-scrollbar-track:vertical { }::-webkit-scrollbar-thumb:vertical { background-color: rgba(136, 141, 152, 0.5) !important; border-radius: 10px !important; background-clip: content-box !important; border:2px solid transparent !important; } ::-webkit-scrollbar-track:horizontal { }::-webkit-scrollbar-thumb:horizontal { background-color: rgba(136, 141, 152, 0.5) !important; border-radius: 10px !important; background-clip: content-box !important; border:2px solid transparent !important; } ::-webkit-resizer { display: none !important; }</style></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>
2021-07-15