Commit a3443a7fa08f31c3df543279f9035e9a162f161c
1 parent
c47d4455
静态码 输入车牌页面 微信授权
Showing
1 changed file
with
9 additions
and
6 deletions
src/components/plateNumber.vue
... | ... | @@ -294,14 +294,17 @@ export default { |
294 | 294 | } |
295 | 295 | }, |
296 | 296 | mounted () { |
297 | - var appID = this.$utils.myVxAppId; | |
298 | - var code = this.getUrlParam('code'); | |
299 | - var local = window.location.href; | |
300 | - if (code == null || code === '') { | |
297 | + if (this.$utils.clientBrowser() == "微信") { | |
298 | + var appID = this.$utils.myVxAppId; | |
299 | + var code = this.getUrlParam('code'); | |
300 | + var local = window.location.href; | |
301 | + if (code == null || code === '') { | |
301 | 302 | 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' |
302 | - } else { | |
303 | - return code; | |
303 | + } else { | |
304 | + return code; | |
305 | + } | |
304 | 306 | } |
307 | + | |
305 | 308 | }, |
306 | 309 | methods: { |
307 | 310 | getUrlParam(name) { | ... | ... |