Open SnowdropK opened 5 years ago
<button v-else open-type="getUserInfo" lang="zh_CN" class='btn' @getuserinfo="login">点击登录
loginSuccess (res) { showSuccess('登录成功') wx.setStorageSync('userinfo', res) this.userinfo = res }, login () { wx.showToast({ title: '登录中', icon: 'loading' }) qcloud.setLoginUrl(config.loginUrl) const session = qcloud.Session.get() if (session) { qcloud.loginWithCode({ success: res => { console.log('没过期的登录', res) this.loginSuccess(res) }, fail: err => { console.error(err) } }) } else { qcloud.login({ success: res => { console.log('登录成功', res) this.loginSuccess(res) }, fail: err => { console.error(err) } }) } }
加一,我也遇到了...用以前创建过腾讯云项目的APPID能正常登陆,新注册的APPID不行,很玄
https://github.com/tencentyun/wafer2-client-sdk#%E7%99%BB%E5%BD%95
这个例子我试过了,报的同样的错误,有可能和楼上那位老铁一样,有可能是因为腾讯云刚刚开通
https://github.com/tencentyun/wafer2-quickstart/issues/13 参考一下这个
tencentyun/wafer2-quickstart#13 参考一下这个
为啥不改文档呢
<button v-else open-type="getUserInfo" lang="zh_CN" class='btn' @getuserinfo="login">点击登录
loginSuccess (res) { showSuccess('登录成功') wx.setStorageSync('userinfo', res) this.userinfo = res }, login () { wx.showToast({ title: '登录中', icon: 'loading' }) qcloud.setLoginUrl(config.loginUrl) const session = qcloud.Session.get() if (session) { qcloud.loginWithCode({ success: res => { console.log('没过期的登录', res) this.loginSuccess(res) }, fail: err => { console.error(err) } }) } else { qcloud.login({ success: res => { console.log('登录成功', res) this.loginSuccess(res) }, fail: err => { console.error(err) } }) } }