| | |
| | | } |
| | | this.setUpWxOpenid(this.username, this.password, uni.getStorageSync('bindCode')) |
| | | }, |
| | | getUserAuth() { |
| | | wx.getSetting({ |
| | | withSubscriptions: true, |
| | | success(res) { |
| | | if (res.subscriptionsSetting == null || res.subscriptionsSetting == undefined || |
| | | res.subscriptionsSetting.itemSettings == null || res.subscriptionsSetting |
| | | .itemSettings == undefined || res.subscriptionsSetting[ |
| | | "bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4"] != 'accept') { |
| | | wx.requestSubscribeMessage({ |
| | | tmplIds: ['bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4'], |
| | | success(res) { |
| | | console.log(res, '获取订阅消息'); |
| | | }, |
| | | fail(e) { |
| | | console.log(e, '订阅消息失败'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | setUpWxOpenid(userName, passWord, code) { |
| | | uni.request({ |
| | | url: `${BaseUrl}/admin/user/setUpWxOpenid`, |
| | |
| | | console.log(res, '绑定结果'); |
| | | if (res.data.code === 1) { |
| | | this.$u.toast(res.data.msg ? res.data.msg : '绑定失败') |
| | | } else { |
| | | this.$u.toast('操作成功') |
| | | } |
| | | } |
| | | }) |