From c3910747dd0336dd09d291b1db03f3b077b9556c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E8=99=9E=E6=B8=A0=E6=88=90=E2=80=9D?= <“yuqucheng2006@qq.com”> Date: Thu, 13 Aug 2026 16:11:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E5=B9=B6=E8=B0=83=E6=95=B4UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 重构第三方登录逻辑,统一登录处理流程 2. 移除BindFireBaseRequest多余的code字段 3. 更新项目版本号至1.0.4 4. 调整登录页面按钮布局与图标 5. 修复权限描述文本格式 --- Assets/Res/ui/loginPage/appleid_button@3x.png | Bin 0 -> 2558 bytes .../ui/loginPage/appleid_button@3x.png.meta | 127 ++++++++++++++++++ Assets/Res/ui/loginPage/loginPage.prefab | 12 +- Assets/Scripts/Managers/DataBase.cs | 1 - .../Scripts/UI/Pages/Login/LoginPageCtrl.cs | 70 +++++++--- ProjectSettings/ProjectSettings.asset | 9 +- 6 files changed, 187 insertions(+), 32 deletions(-) create mode 100644 Assets/Res/ui/loginPage/appleid_button@3x.png create mode 100644 Assets/Res/ui/loginPage/appleid_button@3x.png.meta diff --git a/Assets/Res/ui/loginPage/appleid_button@3x.png b/Assets/Res/ui/loginPage/appleid_button@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..ef2078690a02d4fc62e1fcc88d59bb6dc7909143 GIT binary patch literal 2558 zcmcIm`#;m|8~ZEY)VrjAstdr~ZcL`@?--_x-xx*L`2F*ZaEe_jTLZ$qoTmh64bAus?m$ z1+=tZLv|B5yL=9p0SyG_VrLCB&{bvuK(5{XZ4tXtatru z|5I5F2fD1SYt%9P+X#GlEajG#ri=Tr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4w*#cg)jro*zi_B*uM6PB3~e3RCzT_vn`8vb z;%k3b6$rtP?i_Yeh^lqf`MO>!2oNQXCELrJ7Y5Sk_om7xJG4M8__^5OQm-&m>gB4Bqb>q@yc+^5&ET>ITf z5L{aQq06Hdf>rH!XshGn#AsDGP5x%v)`qme=10+~n-s3=`;E(2EBeO%-Ku@3#;wk^ zj@cZ^wWdTZrRRqf=T;r$5lZs%@^pC*KZb|a;@q$e6^z+s?K|e#v*#YUCO3a1hoFW6 z8SXmygA(l>>D`Q3y>Cj~JZKbxiXEQg@iGzCNZW2~qi^Rq0$A0JV+V{@)6!rQKSVQ& z{Xa)SMod5wwd`a3-#(f=62!jQvzD(V7p-z$8)-;|ZM0reTA;+Kj|GZCDQ-|9scvU`-`RpZ^ig@OW!;86F_JJ6(^Htw2D zmv7_vLzA%pBJEW%7f>OBO1iA+yu||)S3Jq?J}xp6Fy^v1b)%l`Ethm@ce0UNet z0#YXLlKVPl^^J+RW71cDSo$B+Gy`jmghf*UPl)lBCF1x2oP(VDeLMCw$wxwb33O`A zdcPzv&6HazQ;K!FpmAp55cl)&VXN6wSL8t5mlx;>x^3O|HTk8&x~It!QO(Z2O#m&) zS1JNlvRT{l@>@QDG3E9;EtBJIGH`q~L5SbZ_}K2&+j@g@q)2Gi+0fM^l``#vNgGH3 zf)mZLaM#CNUUwpLNhmXJN`VM9gd_^P#APziNLkP - { - Debug.Log(response.token); - - },onError:(code,message)=> - { - Debug.Log(message); - ShowSubPage(SubPageType.ThirdPartyBind); - }); + HandleThirdPartyLogin(result); }, onError: (error) => { @@ -573,16 +564,7 @@ namespace Kill.UI.Pages { LoadingUI.Hide(); Debug.Log($"苹果登录成功: {result.DisplayName}, FirebaseID: {result.FirebaseUserId}"); - SetCurrentFireBaseId(result.FirebaseUserId); - FireBaseLogin(result.FirebaseUserId, onSuccess: (response) => - { - Debug.Log(response.token); - - }, onError: (code, message) => - { - Debug.Log(message); - ShowSubPage(SubPageType.ThirdPartyBind); - }); + HandleThirdPartyLogin(result); }, onError: (error) => { @@ -624,6 +606,53 @@ namespace Kill.UI.Pages onError?.Invoke(-1, ex.Message); } } + + /// + /// 第三方登录成功后的统一处理 + /// 新流程:邮箱直接取自第三方授权,不再强制用户输入邮箱、不再需要验证码 + /// 已绑定帐号走 firebase/login 直接登录;未绑定则用第三方邮箱调 firebase/bind 自动绑定并登录 + /// + private void HandleThirdPartyLogin(GoogleLoginResult result) + { + if (result == null || string.IsNullOrEmpty(result.FirebaseUserId)) + { + Debug.LogError("第三方登录结果无效"); + ToastUI.Show("100042"); // 登录失败提示 + return; + } + SetCurrentFireBaseId(result.FirebaseUserId); + + // 新流程:邮箱必须由第三方授权提供 + if (string.IsNullOrEmpty(result.Email)) + { + Debug.LogError("第三方登录未获取到邮箱"); + ToastUI.Show("100042"); // 登录失败提示 + return; + } + SetCurrentEmail(result.Email); + + FireBaseLogin(result.FirebaseUserId, + onSuccess: (response) => + { + Debug.Log(response.token); + }, + onError: (code, message) => + { + Debug.Log(message); + // 未绑定过第三方帐号 → 使用第三方邮箱直接绑定登录,无需验证码 + BindFireBase("", + onSuccess: (data) => + { + Debug.Log(data.token); + UIManager.Instance.OpenPage(UIManager.PageName.homePage, null, true); + }, + onError: (bindCode, bindMessage) => + { + Debug.LogError($"第三方绑定失败: {bindMessage}"); + ToastUI.Show("100042"); // 登录失败提示 + }); + }); + } @@ -634,7 +663,6 @@ namespace Kill.UI.Pages LoadingUI.Show(); var requestData = new BindFireBaseRequest { - code = code, temp_token = currentFireBaseId, email = currentEmail }; diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index fdadad2..8b13b55 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -145,7 +145,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 1.0.3 + bundleVersion: 1.0.4 preloadedAssets: - {fileID: 7756680987677051820, guid: 0488490a53b3eb2409be4727abdf829a, type: 2} - {fileID: 11400000, guid: d990b2e2bc28cca43863c18940a862a3, type: 2} @@ -565,10 +565,11 @@ PlayerSettings: enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 enableCrashReportAPI: 0 - cameraUsageDescription: "Camera access is used to scan the QR code on your device for pairing." - locationUsageDescription: "Location access is used to detect the current WiFi network." + cameraUsageDescription: Camera access is used to scan the QR code on your device + for pairing. + locationUsageDescription: Location access is used to detect the current WiFi network. microphoneUsageDescription: - bluetoothUsageDescription: "Bluetooth is used to scan for and connect to your device." + bluetoothUsageDescription: Bluetooth is used to scan for and connect to your device. macOSTargetOSVersion: 10.13.0 switchNMETAOverride: switchNetLibKey: