1.优化微信内置浏览器

yj-dev
杨杰 3 years ago
parent 417eb0e7d8
commit f7d9d64673
  1. 21
      pages/login/register.vue
  2. 13
      pages/tabBar/home/home.vue

@ -145,9 +145,15 @@
key: "token", key: "token",
data: res.return_data.uniqueCode data: res.return_data.uniqueCode
}) })
location.href = if (this.isWeiXinLogin()) {
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect' //
location.href ='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'
}else{
uni.reLaunch({
url: '/pages/tabBar/home/home'
})
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.return_msg, title: res.return_msg,
@ -184,6 +190,15 @@
} }
}, },
//
isWeiXinLogin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.search(/MicroMessenger/i) > -1) {
return true;
} else {
return false;
}
},
// //
openWx() { openWx() {
location.href = location.href =

@ -185,10 +185,6 @@
// #endif // #endif
}, },
onLoad() { onLoad() {
if (this.isWeiXinLogin()) {
//
}
// 1.wxcode // 1.wxcode
// #ifdef MP // #ifdef MP
uni.login({ uni.login({
@ -286,15 +282,6 @@
}); });
}, },
//
isWeiXinLogin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.search(/MicroMessenger/i) > -1) {
return true;
} else {
return false;
}
},
//H5 //H5
getH5UserInfo(item) { getH5UserInfo(item) {
let params = { let params = {

Loading…
Cancel
Save