From 8972a69e86c1eb361ffb964579b76c1df3696c3b 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, 23 Jul 2026 14:22:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0firebase=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B9=B6=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 更新安卓端google-services.json配置,新增第三方登录客户端信息 2. 修复Firebase登录时错误日志打印不详细的问题,添加完整错误信息输出 3. 完善第三方绑定流程,保存当前登录邮箱 4. 修复ConnectDevice页面的代码缩进和语法问题 --- .../res/values/google-services.xml | 3 ++- Assets/Plugins/Android/google-services.json | 16 +++++++++++++++ .../Plugins/Android/google-services.json.meta | 4 ++-- .../Scripts/Managers/FirebaseAuthManager.cs | 2 ++ .../ConnectDevice/ConnectDevicePageCtrl.cs | 20 +++++++++++-------- .../Login/SubPages/ThirdPartyBindPanel.cs | 2 ++ 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/Assets/Plugins/Android/FirebaseApp.androidlib/res/values/google-services.xml b/Assets/Plugins/Android/FirebaseApp.androidlib/res/values/google-services.xml index d176677..7005b5e 100644 --- a/Assets/Plugins/Android/FirebaseApp.androidlib/res/values/google-services.xml +++ b/Assets/Plugins/Android/FirebaseApp.androidlib/res/values/google-services.xml @@ -1,10 +1,11 @@ - + 785438724947 photonmatrix-ac0b5.firebasestorage.app photonmatrix-ac0b5 AIzaSyAntcCsZGurbXg7TFbPMPx5aek6HDYYVxk AIzaSyAntcCsZGurbXg7TFbPMPx5aek6HDYYVxk 1:785438724947:android:352ede76bb25311f51c7a6 + 785438724947-1ln4va945bulvago2p5rmis3v47q69mp.apps.googleusercontent.com 785438724947-kpjbqi43hbj6eddianbjsgkgkkclkfmd.apps.googleusercontent.com diff --git a/Assets/Plugins/Android/google-services.json b/Assets/Plugins/Android/google-services.json index 28770f6..fe105b2 100644 --- a/Assets/Plugins/Android/google-services.json +++ b/Assets/Plugins/Android/google-services.json @@ -13,6 +13,22 @@ } }, "oauth_client": [ + { + "client_id": "785438724947-1ln4va945bulvago2p5rmis3v47q69mp.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.photonmatrix.photonmatrix", + "certificate_hash": "57eec536956e93404a93e6c0548ce312a2fb25ff" + } + }, + { + "client_id": "785438724947-tn234msinh5t30d8j4hjm330rb0tkqnd.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.photonmatrix.photonmatrix", + "certificate_hash": "40dced4580e8d4ac62e0b77b5a210bfb4cd43cc8" + } + }, { "client_id": "785438724947-kpjbqi43hbj6eddianbjsgkgkkclkfmd.apps.googleusercontent.com", "client_type": 3 diff --git a/Assets/Plugins/Android/google-services.json.meta b/Assets/Plugins/Android/google-services.json.meta index e427672..532d6ce 100644 --- a/Assets/Plugins/Android/google-services.json.meta +++ b/Assets/Plugins/Android/google-services.json.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: d7664919531ad8848b3832a934c32835 -TextScriptImporter: +guid: 914ba5889714dbb4cb7dd23e9a1f2ebd +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Scripts/Managers/FirebaseAuthManager.cs b/Assets/Scripts/Managers/FirebaseAuthManager.cs index 843eb80..950728c 100644 --- a/Assets/Scripts/Managers/FirebaseAuthManager.cs +++ b/Assets/Scripts/Managers/FirebaseAuthManager.cs @@ -253,6 +253,8 @@ namespace Kill.Managers if (task.IsFaulted) { + var errorMsg = task.Exception?.InnerException?.Message ?? task.Exception?.Message ?? "未知错误"; + Debug.LogError($"Firebase {providerId} 登录失败详情: {errorMsg}"); MainThread.Enqueue(() => onError?.Invoke($"{providerId} 登录失败")); return; } diff --git a/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs b/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs index 04ca911..b3bc866 100644 --- a/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs +++ b/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs @@ -78,17 +78,21 @@ public class ConnectDevicePageCtrl : MonoBehaviour qrCodePlane.GetComponent().Close(); foreach(var d in DataManager.Instance.OwnedDevices) { - if(d.ble_mac==result) - ToastUI.Show("100287"); - qrCodePlane.GetComponent().OnQRCodeScanned+=GetQrResult; - return; + if (d.ble_mac == result) + { + ToastUI.Show("100287"); + qrCodePlane.GetComponent().OnQRCodeScanned += GetQrResult; + return; + } } foreach(var d in DataManager.Instance.SharedDevices) { - if(d.ble_mac==result) - ToastUI.Show("100287"); - qrCodePlane.GetComponent().OnQRCodeScanned+=GetQrResult; - return; + if (d.ble_mac == result) + { + ToastUI.Show("100287"); + qrCodePlane.GetComponent().OnQRCodeScanned += GetQrResult; + return; + } } isconnecting=true; BluetoothManager.Instance.Connect(result); diff --git a/Assets/Scripts/UI/Pages/Login/SubPages/ThirdPartyBindPanel.cs b/Assets/Scripts/UI/Pages/Login/SubPages/ThirdPartyBindPanel.cs index d485d73..71467a7 100644 --- a/Assets/Scripts/UI/Pages/Login/SubPages/ThirdPartyBindPanel.cs +++ b/Assets/Scripts/UI/Pages/Login/SubPages/ThirdPartyBindPanel.cs @@ -51,6 +51,8 @@ namespace Kill.UI.Pages } else { + // 保存邮箱到登录控制器 + LoginPageCtrl.Instance.SetCurrentEmail(email); // 设置验证码页面为注册场景 var verifyPanel = GetSubPage(LoginPageCtrl.SubPageType.VerificationCode) as VerificationCodePanel; if (verifyPanel != null)