button组件获取用户登录信息getUserInfo线上环境出问题
发布于 6 年前 作者 kangjie 9708 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图) 本地登录没有问题,但是每次审核都出现问题,点击授权登录按钮无法响应
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

以下是代码片段

<text></text>

<view>

<view class=‘cont’>

<view class=‘mytext’>您还没有登录!</view>

<view class=‘mytext’>登录后就可以尽情抢红包啦!</view>

<view class=‘mytext’>赶快去登录抢红包吧!</view>

</view>

<button class=‘mybtn’ open-type=“getUserInfo” bindgetuserinfo=“goIndex”>授权登录</button>

<button class=‘lsbtn’ open-type=“openSetting” bindopensetting=“callback”>打开设置页</button>

</view>

goIndex:function(res){

console.log(app.globalData.options);

if(res.detail.userInfo){

app.globalData.myInfo=res.detail.userInfo;

// wx.reLaunch({

//   url: ‘/pages/shop/shop’,

// })

if(app.globalData.options.path.length>10){

wx.reLaunch({

url: ‘/pages/’ + app.globalData.options.path.replace(‘pages/’,’’) + this.getQuery(app.globalData.options.query),

})

}else{

wx.reLaunch({

url: ‘/pages/shop/shop’,

})

}

}else{

wx.showModal({

title: ‘授权失败’,

content: ‘未获取到您的登录信息,是否重新授权?’,

confirmText: “去授权”,

})

}

},

1 回复

报错信息呢?

调试下?

回到顶部