This commit is contained in:
wulongxiao 2024-12-13 22:29:51 +08:00
commit 2e547a1aca
13 changed files with 11177 additions and 322 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b23b57eee7c9e744baea79d6acccb20f
guid: 94125ad1b9441324a849a6cc3aa291aa
DefaultImporter:
externalObjects: {}
userData:

View File

@ -82,4 +82,7 @@ public class BaseUI :Base
// 헌왕객큐莉
BTNs.Clear();
}
//public
}

View File

@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public enum MoneyType {
@ -15,6 +16,8 @@ public enum MoneyType {
public class PlayerManager
{
private static PlayerManager _instance;
public Main_jiekou main_Jiekou;
public static PlayerManager Instance
{
get
@ -28,6 +31,8 @@ public class PlayerManager
}
}
public float Stones = 10000;
public float Forging = 10000;
public float Coins = 10000;

View File

@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class Main_jiekou : MonoBehaviour
{
public playerInfo playerInfo;
public async Task<PlayerIndfo> PalyerInfos()
{
playerInfo = new playerInfo();
return await playerInfo.PalyerInfo();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1d80c3a4c232104428002003b2b35949
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -80,8 +80,18 @@ public class Logo_in : mount
}
else if (type == 1)//提交
{
gameObject.GetComponent<input_box_pop_up_window>().destroy();
bool issucceffull = await loading_Jiekou.RealNameAuthentications(boxTypes[1].content, boxTypes[2].content);
if (issucceffull)
{
gameObject.SetActive(false);
Promptmgr.Instance.PromptBubble("登录成功");
sceneslider.gameObject.SetActive(true);
StartCoroutine(jiaLoading());
}
else
{
Promptmgr.Instance.PromptBubble("实名认证信息有误,请重新输入");
}
}
});
@ -104,7 +114,7 @@ public class Logo_in : mount
{
if (type == 0) //发送验证码按钮
{
bool response = await loading_Jiekou.SendCode(boxTypes[0].content,1);
bool response = await loading_Jiekou.SendCodes(boxTypes[0].content,1);
if (response)
{
Promptmgr.Instance.PromptBubble("发送成功");
@ -115,7 +125,7 @@ public class Logo_in : mount
}
}
});
gameObjects[4].GetComponent<input_box_pop_up_window_item>().register_click(
gameObjects[4].GetComponent<input_box_pop_up_window_item>().register_click(
async (BoxType boxType, int type) => //注册确定或取消
{
if (type == 0) //返回登录
@ -125,25 +135,10 @@ public class Logo_in : mount
}
else if (type == 1) //确认注册并登录并进行实名认证
{
RegisterResponse response = await loading_Jiekou.Register(boxTypes[0].content, boxTypes[1].content, boxTypes[2].content, boxTypes[3].content);
Debug.Log(response.message);
gameObject.GetComponent<input_box_pop_up_window>().destroy();
//这里验证码校验有问题,以及账号校验还没做
//bool succefful =await loading_Jiekou.CheckCode(boxTypes[0].content, 1, boxTypes[3].content);
//if (succefful)
//{
// RegisterResponse response = await loading_Jiekou.Register(boxTypes[0].content, boxTypes[1].content, boxTypes[2].content, boxTypes[3].content);
// Debug.Log(response.message);
// gameObject.GetComponent<input_box_pop_up_window>().destroy();
//}
//else
//{
//}
// Real_name_screen();
RegisterResponse response = await loading_Jiekou.Registers(boxTypes[0].content, boxTypes[1].content, boxTypes[2].content, boxTypes[3].content);
Debug.Log(response.message);
Real_name_screen();
}
});
}
@ -167,7 +162,7 @@ public class Logo_in : mount
}
else if (type == 1)
{
string response = await loading_Jiekou.Login("app", boxTypes[0].content, boxTypes[1].content, "password");
string response = await loading_Jiekou.Logins("app", boxTypes[0].content, boxTypes[1].content, "password");
loginResponse apifox = JsonConvert.DeserializeObject<loginResponse>(response);
Debug.Log(response);
@ -212,7 +207,7 @@ public class Logo_in : mount
{
if (type == 0)
{
bool response =await loading_Jiekou.SendCode(boxTypes[0].content);
bool response =await loading_Jiekou.SendCodes(boxTypes[0].content);
if (response)
{
Promptmgr.Instance.PromptBubble("发送成功");
@ -246,16 +241,24 @@ public class Logo_in : mount
else if (type == 1)//登录
{
string response = await loading_Jiekou.Login("app", boxTypes[0].content, boxTypes[1].content, "code");
string response = await loading_Jiekou.Logins("app", boxTypes[0].content, boxTypes[1].content, "code");
loginResponse apifox = JsonConvert.DeserializeObject<loginResponse>(response);
Debug.Log(response);
if (apifox.code == 200)
{
gameObject.SetActive(false);
Promptmgr.Instance.PromptBubble("登录成功");
sceneslider.gameObject.SetActive(true);
StartCoroutine(jiaLoading());
PlayerIndfo info = await loading_Jiekou.PalyerInfos();
if (info.Data.certify_status == -1)
{
Real_name_screen();
}
else
{
gameObject.SetActive(false);
Promptmgr.Instance.PromptBubble("登录成功");
sceneslider.gameObject.SetActive(true);
StartCoroutine(jiaLoading());
}
}
else
{

View File

@ -11,20 +11,24 @@ public class loading_jiekou : MonoBehaviour
public sendCode sendCode;
public checkCode checkCode;
public register register;
public playerInfo playerInfo;
/// <summary>
/// 实名认证会返回是否成功
/// </summary>
/// <param name="name"></param>
/// <param name="identity_card_no"></param>
/// <returns></returns>
public async Task<bool> RealNameAuthentication(string name, string identity_card_no)
public async Task<bool> RealNameAuthentications(string name, string identity_card_no)
{
_realNameAuthentication = new realNameAuthentication();
return await _realNameAuthentication.RealNameAuthentication(name, identity_card_no);
RealNameBody body = new RealNameBody();
body.name = name;
body.identity_card_no = identity_card_no;
return await _realNameAuthentication.RealNameAuthentication(body);
}
public async Task<string> Login(string client_id,string username,string password,string type)//登录,这里传入参数的请求体
public async Task<string> Logins(string client_id,string username,string password,string type)//登录,这里传入参数的请求体
{
login = new login();
loginBody loginBody = new loginBody();
@ -37,7 +41,7 @@ public class loading_jiekou : MonoBehaviour
return response;
}
public async Task<bool> SendCode(string account,int scene=0)//发送验证码
public async Task<bool> SendCodes(string account,int scene=0)//发送验证码
{
sendCode = new sendCode();
SendCodeBody sendCodeBody = new SendCodeBody();
@ -56,7 +60,7 @@ public class loading_jiekou : MonoBehaviour
return await checkCode.CheckCode(checkCodeBody);
}
public async Task<RegisterResponse> Register(string account, string password, string inviteCode, string code)//注册用户
public async Task<RegisterResponse> Registers(string account, string password, string inviteCode, string code)//注册用户
{
register = new register();
registerBody registerBody = new registerBody();
@ -68,7 +72,13 @@ public class loading_jiekou : MonoBehaviour
return await register.Register(registerBody);
}
public async Task<bool> Logout()//登录退出
public async Task<PlayerIndfo> PalyerInfos()
{
playerInfo = new playerInfo();
return await playerInfo.PalyerInfo();
}
public async Task<bool> Logout()//登录退出
{
logout = new logout();

View File

@ -6,17 +6,12 @@ using UnityEngine;
//发送验证码
public class sendCode : MonoBehaviour
{
public Dictionary<string, string> CreateHeaders()
public Dictionary<string, string> CreateHeadersTologin()
{
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token))
{
Debug.LogWarning("尝试创建请求头时token 未设置。");
return new Dictionary<string, string>();
}
return new Dictionary<string, string>
{
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
//{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
};
}
@ -27,7 +22,7 @@ public class sendCode : MonoBehaviour
//body.scene = 0;
//Debug.Log(JsonConvert.SerializeObject(body) + "入参=========");
//Debug.Log(JsonConvert.SerializeObject(CreateHeaders()) + "==========头=========");
string response = await myWeb.SendRequest(myWeb.URL + "/api/captcha/send_code", "POST", JsonConvert.SerializeObject(body), CreateHeaders());
string response = await myWeb.SendRequest(myWeb.URL + "/api/captcha/send_code", "POST", JsonConvert.SerializeObject(body), CreateHeadersTologin());
Debug.Log("发送验证码" + response);
SendCodeResponse sendCode = JsonConvert.DeserializeObject<SendCodeResponse>(response);
myResponse CheckCodeResponse = JsonConvert.DeserializeObject<myResponse>(response);

View File

@ -7,20 +7,16 @@ using UnityEngine;
public class checkAccount: MonoBehaviour
{
//playerInfo playerInfo = new playerInfo();
public Dictionary<string, string> CreateHeaders()
public Dictionary<string, string> CreateHeadersTologin()
{
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token))
{
Debug.LogWarning("尝试创建请求头时token 未设置。");
return new Dictionary<string, string>();
}
return new Dictionary<string, string>
{
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
//{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
};
}
public async Task<bool> CheckAccount()
{
playerInfo playerInfo = new playerInfo();
@ -28,7 +24,7 @@ public class checkAccount: MonoBehaviour
CheckAccountBody body = new CheckAccountBody();
//Debug.Log(playerIndfo.Data.account);
body.account = playerIndfo.Data.account;
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/check_account", "POST", JsonConvert.SerializeObject(body), CreateHeaders());
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/check_account", "POST", JsonConvert.SerializeObject(body), CreateHeadersTologin());
Debug.Log("Õ˺ÅУÑé" + response);
myResponse CheckAccountResponse = JsonConvert.DeserializeObject<myResponse>(response);
bool isSucceed;

View File

@ -24,6 +24,7 @@ public class playerInfo : MonoBehaviour
}
public async Task<PlayerIndfo> PalyerInfo()
{
Debug.Log("进入用户详情");
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/detail", "GET", "{}", CreateHeaders());
Debug.Log("用户详情" + response);
PlayerIndfo playerIndfo = JsonConvert.DeserializeObject<PlayerIndfo>(response);

View File

@ -22,11 +22,11 @@ public class realNameAuthentication : MonoBehaviour
}
//===========实名认证==============================================================================================
public async Task<bool> RealNameAuthentication(string name, string identity_card_no)//呢称需要包含中文可以跟字母组合,但必须大于两个//只能更新名字头像
public async Task<bool> RealNameAuthentication(RealNameBody body)//呢称需要包含中文可以跟字母组合,但必须大于两个//只能更新名字头像
{
RealNameBody body = new RealNameBody();
body.name = name;
body.identity_card_no = identity_card_no;
//RealNameBody body = new RealNameBody();
//body.name = name;
//body.identity_card_no = identity_card_no;
//Debug.Log("=====" + body);
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/certify/commit", "POST", JsonConvert.SerializeObject(body), CreateHeaders());
Debug.Log("实名认证" + response);

View File

@ -28,6 +28,7 @@ public class register : MonoBehaviour
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/register", "POST", JsonConvert.SerializeObject(body), CreateHeadersTologin());
Debug.Log("×¢²á" + response);
RegisterResponse register = JsonConvert.DeserializeObject<RegisterResponse>(response);
MyGlobal.global.loginResponse.Data.access_token = register.data.token.access_token;
Debug.Log("=====zhuce======" + register.data.token.expires_in);
return register;
}