| | |
| | | WeChatTools.getUserInfo(access_token: m.access_token, openId: m.openid) { userInfoModel in |
| | | if let u = userInfoModel{ |
| | | if UserViewModel.getAvatarInfo().wxOpenId.isEmpty{ |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid, device: UserViewModel.DeviceUUID).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | if model.bindStatus == 2{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |
| | | let vc = UpdatePhoneVC(wechatInfoModel: u,firstAccessToken: model.accessToken) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |