| | |
| | | storage.setItem('token', resp.data.access_token) |
| | | commit("updateLogin", true) |
| | | await dispatch('getCurrentInfo') |
| | | //todo 登录后可能需要进行绑定 |
| | | try { |
| | | var sharePartnerUserId = storage.getItem('cache_sharePartnerUserId') |
| | | if (sharePartnerUserId) { |
| | | //试图绑定 |
| | | storage.removeItem('cache_sharePartnerUserId') |
| | | if (state.currentInfo.customerDTO && !state.currentInfo.customerDTO.partnerId) { |
| | | message.showLoading() |
| | | const bindres = await http.request('post', '/api/customer/bind/partner', { |
| | | data: { |
| | | partnerUserId: sharePartnerUserId |
| | | } |
| | | }) |
| | | message.hideLoading() |
| | | if (bindres.code == 0) { |
| | | message.showToast(`绑定合伙人成功`) |
| | | await dispatch('getCurrentInfo') |
| | | } |
| | | } |
| | | |
| | | } |
| | | } catch (e) { |
| | | console.error('login ', e) |
| | | } |
| | | |
| | | uni.reLaunch({ |
| | | url: '/pages/home/home' |
| | | }) |