微信授权问题?
大佬问一个问题,我们的小程序上线了,为什么我们管理员可以授权成功,为什么别的用户不能成功呢
大佬问一个问题,我们的小程序上线了,为什么我们管理员可以授权成功,为什么别的用户不能成功呢
//页面跳转 _getGo() { wx.redirectTo({ url: '../evaluate/evaluate' }) }, _login() {//授权登录 wx.login({ success: res => { console.log(res) // 获取code const code = res.code; console.log(code) wx.request({ url: 'https://www.samewarm.com/Sandy/v2.0/userOpenIdHuiYiShi/fo', data: { code }, method: 'get', success: res => { console.log(res.data.Value) const str = res.data.Status; const names = res.data.Value.WeChat; //判断用户是否认证 if (str == true) { if (names == "Initialize") { //新用户没有登录过 const openId = res.data.Value.OpenId; //获取的openid const SessionKey = res.data.Value.SessionKey; //获取的SessionKey const UnionId = res.data.Value.UnionId; //获取的UnionId this.setData({ //更新状态 openId, SessionKey, UnionId }) wx.setStorageSync('key', { //缓存数据 SessionKey1: this.data.SessionKey, openId1: this.data.openId, UnionId1: this.data.UnionId }) const sfz = this.data.isHide //如果是新用户就显示授权页面 this.setData({ isHide: true }) } else { //老用户 //把这些缓存上UserId Token console.log("123") this._getGo() /*缓存token和userId**/ wx.setStorageSync('UTR', { /*缓存token和userId**/ UserId: res.data.Value.UserId, Token: res.data.Value.Token, RefreshToken: res.data.Value.RefreshToken }) this.setData({ isHide: false }) } } |