$(window).load(function () { var isweixin = is_weixin(); if (isweixin) { var guid = GetQueryString("itemId"); window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7359c49ea4a34c8f&redirect_uri=http%3a%2f%2fwxyyb.biotecan.com%2fxuexi%2findex.php%2fHome%2fProductDetail%2fproductdetail%2fproductDetail%2f" + guid + ‘.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect‘; } $(‘body‘).addClass(‘loaded‘); $(‘#loader-wrapper‘).remove(); }); //获取链接参数 function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } function is_weixin() { var ua = window.navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { //判断是否是微信打开 return true; } else { return false; }
原文地址:https://www.cnblogs.com/quitpoison/p/10795470.html
时间: 2024-10-13 09:32:37