在須要限制的頁面加上 appid必填,能夠獲取也能夠本身隨意javascript
<script> var ua = navigator.userAgent.toLowerCase(); var isWeixin = ua.indexOf('micromessenger') != -1; if (!isWeixin) { window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=888" } </script>