Commit c04893106351321321bba8e76e2a1479daaaea67

Authored by liuqimichale
1 parent 45145547

静态码 输入车牌页面 微信授权

Showing 1 changed file with 10 additions and 8 deletions
src/components/plateNumber.vue
@@ -322,16 +322,18 @@ export default { @@ -322,16 +322,18 @@ export default {
322 mounted() { 322 mounted() {
323 console.log(window.location) 323 console.log(window.location)
324 console.log(this.$route.query) 324 console.log(this.$route.query)
325 -  
326 - var appID = this.$utils.myVxAppId;  
327 - var code = this.getUrlParam('code');  
328 - var local = window.location.href;  
329 - if (code == null || code === '') {  
330 - window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appID+'&redirect_uri='+encodeURIComponent(local)+'&response_type=code&scope=snsapi_userinfo&state=1,0#wechat_redirect'  
331 - } else {  
332 - return code; 325 + if (this.$utils.clientBrowser() == "微信") {
  326 + var appID = this.$utils.myVxAppId;
  327 + var code = this.getUrlParam('code');
  328 + var local = window.location.href;
  329 + if (code == null || code === '') {
  330 + window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appID+'&redirect_uri='+encodeURIComponent(local)+'&response_type=code&scope=snsapi_userinfo&state=1,0#wechat_redirect'
  331 + } else {
  332 + return code;
  333 + }
333 } 334 }
334 335
  336 +
335 let params = this.$route.query 337 let params = this.$route.query
336 if (Object.keys(params).length == 0) { 338 if (Object.keys(params).length == 0) {
337 339