- getPhoneNumbe button 组件走登陆 5分钟授权但是后端接口提示1005?
微信版本8.0.17 基础库2.21.4 button getphoneNumber登录,页面初始化获取了code然后我操作登录授权是页面初始化10分钟左右,然后提示我1005 <button type="default" :loading="loginLoading" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber" class="login__wx" >授权登录</button> getWxcode () { wx.login({ provider: 'weixin', success: (loginRes) => { this.code = loginRes.code uni.setStorageSync('tyycode', loginRes.code) } }) }, decryptPhoneNumber (e) { if (this.loginLoading) return if (e.detail.errMsg === 'getPhoneNumber:ok') { uni.showLoading({ title: '登录中...' }) const encryptedData = e.detail.encryptedData const iv = e.detail.iv wx.checkSession({ success: (res) => { console.log(res) this.phoneLogin(encryptedData, iv) }, fail: (err) => { uni.login({ provider: 'weixin', success: (res) => { this.code = res.code this.phoneLogin(encryptedData, iv) } }) } }) } }, async phoneLogin (encryptedData, iv) { let _this = this this.loginLoading = true const resData = await api.login.wxLogin({ encryptedData, iv, code: this.code }) const { errcode = '', data = {}, message = '登录失败' } = resData uni.hideLoading() if (errcode === 0) { // "is_need_login": 2 // 是否需要重新登陆:0不需要,1需要 const { api_token = '' } = data uni.showToast({ title: '登录成功', icon: 'success', duration: 1500, success: () => { uni.setStorageSync('api_token', api_token) _this.$store.commit(IS_NEED_LOGIN, 0) _this.loginLoading = false uni.reLaunch({ url: `/pages/index/index` }) } }) } else if (errcode === 1500) { this.$refs['popup'].open() this.getWxcode() this.loginLoading = false } else { this.loginLoading = false this.getWxcode() uni.showToast({ title: message, icon: 'none' }) } }, popupClick () { this.$refs['popup'].close() } },
2022-01-21 - vue使用微信的组件wx-open-launch-weapp script里边的button没渲染
<wx-open-launch-weapp style="height: 90px;width: 100%;" id="launch-btn" username="gh_9a674dd" path="/pages/index/index.html" @error="handleErrorFn" > <script type="text/wxtag-template"> <style>.btn { padding: 12px }</style> <button class="btn">打开小程序</button> </script> </wx-open-launch-weapp> https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html [图片]
2021-04-06