2026-02-03 11:35:19 +08:00
|
|
|
|
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()
|
|
|
|
|
|
{
|
2026-04-08 18:31:24 +08:00
|
|
|
|
APIRequestList.LoginPhone(
|
2026-02-03 11:35:19 +08:00
|
|
|
|
new LoginParam { mobile = "13800138000", code = "1234" },
|
|
|
|
|
|
res =>
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2026-04-08 18:31:24 +08:00
|
|
|
|
//APIRequestList.Register(
|
|
|
|
|
|
// new RegisterObj { mobile = "13800138000", code = "1234", password = "abc123" },
|
|
|
|
|
|
// res =>
|
|
|
|
|
|
// {
|
2026-02-03 11:35:19 +08:00
|
|
|
|
|
2026-04-08 18:31:24 +08:00
|
|
|
|
// }
|
|
|
|
|
|
//);
|
2026-02-03 11:35:19 +08:00
|
|
|
|
APIRequestList.LoginWx(
|
|
|
|
|
|
new LoginWxParam
|
|
|
|
|
|
{
|
|
|
|
|
|
openId = "wx_openid_123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
res =>
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
#region Login
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 微信用户登录(GET)
|
|
|
|
|
|
/// Swagger Summary: 微信用户登陆
|
|
|
|
|
|
/// 参数:
|
|
|
|
|
|
/// openId: 微信 openId
|
|
|
|
|
|
/// 返回:
|
|
|
|
|
|
/// UserToken(包含 token、用户信息等)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void LoginWx(LoginWxParam req, Action<UserToken> callback)
|
|
|
|
|
|
{
|
|
|
|
|
|
APIManager.Response<UserToken>(APIType.Login_LoginWx, req, obj =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Instance.user = obj;
|
|
|
|
|
|
callback?.Invoke(obj);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2026-04-08 18:31:24 +08:00
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 注册
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//public static void Register(RegisterObj req, Action<UserToken> callback)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// APIManager.Response<UserToken>(APIType.Login_Register, req, obj =>
|
|
|
|
|
|
// {
|
|
|
|
|
|
// GameManager.Instance.user = obj;
|
|
|
|
|
|
// callback?.Invoke(obj);
|
|
|
|
|
|
// });
|
|
|
|
|
|
//}
|
2026-02-03 11:35:19 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 登录(GET)
|
|
|
|
|
|
/// </summary>
|
2026-04-08 18:31:24 +08:00
|
|
|
|
public static void LoginPhone(LoginParam req, Action<UserToken> callback)
|
2026-02-03 11:35:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
APIManager.Response<UserToken>(APIType.Login_Login, req, obj =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Instance.user=obj;
|
|
|
|
|
|
callback?.Invoke(obj);
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 注册(POST)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void Register(RegisterObj req, Action<UserToken> callback)
|
|
|
|
|
|
{
|
|
|
|
|
|
APIManager.Response<UserToken>(APIType.Login_Register, req, obj =>
|
|
|
|
|
|
{
|
|
|
|
|
|
callback?.Invoke(obj);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|