| | |
| | | this.$u.toast(res.msg); |
| | | } |
| | | } else { |
| | | this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('code') }, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('绑定成功!即将回到登录页!'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '绑定失败'); |
| | | uni.login({ |
| | | success: res => { |
| | | if (res.code) { |
| | | uni.setStorageSync('bindcode', res.code); |
| | | } |
| | | } |
| | | }); |
| | | if (uni.getStorageSync('bindcode')) { |
| | | this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') }, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('绑定成功!即将回到登录页!'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '绑定失败'); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | .catch(e => { |