UserProxy.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using UnityEngine;
  6. public class UserProxy : DataProxy
  7. {
  8. public UserInfo userInfo = new UserInfo();
  9. public override void OnRegister()
  10. {
  11. userInfo.userName = "Chiva";
  12. }
  13. /// <summary>
  14. /// 用户登录
  15. /// </summary>
  16. public StudentLoginResponse UserLogin(string account,string password)
  17. {
  18. StudentLoginResponse response = GrpcChannelContronller.Instance.client.StudentLogin(new StudentLoginRequest() {PhoneNumber = account,Password = password});
  19. if (response != null && response.Result == true)
  20. {
  21. userInfo.userName = response.Name;
  22. userInfo.phoneNumber = account;
  23. }
  24. return response;
  25. }
  26. public override void OnRemove()
  27. {
  28. }
  29. }
  30. public class UserInfo
  31. {
  32. /// <summary>
  33. /// 用户名
  34. /// </summary>
  35. public string userName;
  36. /// <summary>
  37. /// 账号
  38. /// </summary>
  39. public string phoneNumber;
  40. }