https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html
调用方法,wx.login({
provider:'weixin',
success:function(loginres){
console.log(loginres.code)
wx.getGroupEnterInfo({
success(res){
console.log(res)
that.encryptedData =res.encryptedData
that.iv = res.iv
if(res.errMsg==="getGroupEnterInfo:fail invalid shareTicket"){
that.show3= true
}else{
uni.request({
url:that.sercUrl+ '&r=group.join',
method:'POST',
data:{
uid:that.uid,
gid:that.gid,
iv:that.iv,
encryptedData:that.encryptedData,
code:loginres.code,
latitude:that.latitude,
longitude:that.longitude,
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success:function(e){}}
模拟器访问可以成功,手机上访问就-41003