| | |
| | | //查询用户详细信息并储存 |
| | | this.$reqGet('getUserEntity') |
| | | .then(res => { |
| | | this.$u.toast('恭喜您,登录成功!'); |
| | | this.$u.toast('登录成功'); |
| | | this.setUserTabbar(res.data.type); |
| | | uni.setStorageSync('roleType', res.data.type); |
| | | setCustomerId(res.data.customerid); |
| | |
| | | this.$u.toast(res.msg); |
| | | } |
| | | } else { |
| | | this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('openid') }, '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 => { |