From c649531411191cd60591eafcd9c3b9a9fede13e4 Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期三, 20 十一月 2024 17:56:56 +0800 Subject: [PATCH] fix bug --- XQMuse/Root/Login/VC/UpdatePhoneVC.swift | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/XQMuse/Root/Login/VC/UpdatePhoneVC.swift b/XQMuse/Root/Login/VC/UpdatePhoneVC.swift index 6ab3a5c..f177d1f 100644 --- a/XQMuse/Root/Login/VC/UpdatePhoneVC.swift +++ b/XQMuse/Root/Login/VC/UpdatePhoneVC.swift @@ -119,11 +119,20 @@ } - Services.confirmByApple(cellPhone: tf_phone.text!, captcha: tf_code.text!, loginType: threePlantformLoginType, wxOrAppleId: unionId,name: formatName, mail: credential!.email).subscribe(onNext: {data in + Services.confirmByApple(cellPhone: tf_phone.text!, captcha: tf_code.text!, loginType: threePlantformLoginType, wxOrAppleId: unionId,name: formatName, mail: credential?.email).subscribe(onNext: {data in if var model = data.data{ - model.loginByAppleToken = String(data: self.credential!.identityToken!, encoding: .utf8) + + if threePlantformLoginType == .apple{ + model.loginByAppleToken = String(data: self.credential!.identityToken!, encoding: .utf8) + model.appleId = self.credential!.user + } + + if threePlantformLoginType == .wechat{ + model.wechatOpenId = unionId + } + model.accessToken = model.accessToken - model.appleId = self.credential!.user + UserViewModel.saveLoginInfo(model) Services.getUserInfo().subscribe(onNext: {data in -- Gitblit v1.7.1