using Assets.MyGame.Scripts.Net.API; using Assets.MyGame.Scripts.Net.APIRequest.Objs; using Assets.MyGame.Scripts.Net.APIRequest.Params; using System; using System.Security.Cryptography; using UnityEngine; namespace Assets.MyGame.Scripts.Net { public static partial class APIRequestList { static void lizi() { APIRequestList.LoginPhone( new LoginParam { mobile = "13800138000", code = "1234" }, res => { } ); //APIRequestList.Register( // new RegisterObj { mobile = "13800138000", code = "1234", password = "abc123" }, // res => // { // } //); APIRequestList.LoginWx( new LoginWxParam { openId = "wx_openid_123456" }, res => { } ); } #region Login /// /// 微信用户登录(GET) /// Swagger Summary: 微信用户登陆 /// 参数: /// openId: 微信 openId /// 返回: /// UserToken(包含 token、用户信息等) /// public static void LoginWx(LoginWxParam req, Action callback) { APIManager.Response(APIType.Login_LoginWx, req, obj => { GameManager.Instance.user = obj; callback?.Invoke(obj); }); } ///// ///// 注册 ///// //public static void Register(RegisterObj req, Action callback) //{ // APIManager.Response(APIType.Login_Register, req, obj => // { // GameManager.Instance.user = obj; // callback?.Invoke(obj); // }); //} /// /// 登录(GET) /// public static void LoginPhone(LoginParam req, Action callback) { APIManager.Response(APIType.Login_Login, req, obj => { GameManager.Instance.user=obj; callback?.Invoke(obj); }); } /// /// 注册(POST) /// public static void Register(RegisterObj req, Action callback) { APIManager.Response(APIType.Login_Register, req, obj => { callback?.Invoke(obj); }); } /// /// 更改密码(Get) /// public static void ResetPassword(ReSetPassWordParam req, Action callback) { APIManager.Response(APIType.Login_ResetPassWord, req, obj => { callback?.Invoke(obj); }); } /// /// 获取验证码(Get) /// public static void YZM(YZMParam req, Action callback) { APIManager.Response(APIType.Login_SendMobileCode, req, obj => { callback?.Invoke(obj); }); } #endregion } }