Browse Source

上传登录成功后的token

蓝色星空 1 year ago
parent
commit
9a2224b330

+ 5 - 3
Assets/Game/Blue/RTC/Service/RTCService.cs

@@ -149,16 +149,18 @@ public class RTCService : IRTCService
     {
         mRTCRoomInfo = JsonConvert.DeserializeObject<RTCRoomInfo>(e.rtcRoomInfo);
         Debug.LogError($"创建房间成功,房间ID:{mRTCRoomInfo.roomId}");
+        Debug.LogError($"地址链接:https://{mRTCRoomInfo.host}");
+        Debug.LogError($"Token:{mRTCRoomInfo.token}");
         //ConnectByRTCUrl(e.rtcRoomInfo.host);
-
-        JoinRoom(mRTCRoomInfo.roomId);
     }
 
     // 加入房间
     private void JoinRoomSuccess(JoinRoomSuccessEvent e)
     {
         mRTCRoomInfo = JsonConvert.DeserializeObject<RTCRoomInfo>(e.rtcRoomInfo);
-        Debug.LogError($"加入房间成功,房间号:{mRTCRoomInfo.roomId}");
+        Debug.LogError($"创建房间成功,房间ID:{mRTCRoomInfo.roomId}");
+        Debug.LogError($"地址链接:https://{mRTCRoomInfo.host}");
+        Debug.LogError($"Token:{mRTCRoomInfo.token}");
     }
 
     // 连接RTC

+ 9 - 1
Assets/Game/ShowLogin/LangChaoLogin.cs

@@ -76,7 +76,15 @@ namespace GHZLangChao
             if (obj["code"].ToString() != "200")
                 StartCoroutine(PopUp());
             else
-                ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
+            {
+                if (!string.IsNullOrWhiteSpace(obj["data"].ToString()) && !string.IsNullOrWhiteSpace(obj["data"]["token"].ToString()))
+                {
+                    login.UserInfo.Instance.Token = obj["data"]["token"].ToString();
+                    ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
+                }
+                else
+                    StartCoroutine(PopUp());
+            }
         }
 
         private IEnumerator PopUp()