手机验证码请求 新增第三方网络等待

main
Yuntao Hu 2024-10-17 19:34:46 +08:00
parent 3ab78e42f8
commit f560da3836
2 changed files with 12 additions and 2 deletions

View File

@ -78,7 +78,15 @@ public class WaitingForServer : Singlenton<WaitingForServer>, IInitable, IUpdata
/// </summary>
public enum EventName
{
/// <summary>
/// 登录请求
/// </summary>
LoginRequest,
/// <summary>
/// 验证码第三方请求
/// </summary>
PhoneCodeRequest,
}
/// <summary>

View File

@ -315,10 +315,12 @@ public class PhoneVerifyTool : Singlenton<PhoneVerifyTool>
www.SetRequestHeader("signature", headData["signature"]);
www.SetRequestHeader("timestamp", headData["timestamp"]);
www.SetRequestHeader("accessKey", headData["accessKey"]);
WaitingForServer.Instance.EventWaiting(WaitingForServer.EventName.PhoneCodeRequest);
try
{
await www.SendWebRequest();
WaitingForServer.Instance.EventDone(WaitingForServer.EventName.PhoneCodeRequest);
if (www.result != UnityWebRequest.Result.Success)
{
@ -391,11 +393,11 @@ public class PhoneVerifyTool : Singlenton<PhoneVerifyTool>
www.SetRequestHeader("signature", headData["signature"]);
www.SetRequestHeader("timestamp", headData["timestamp"]);
www.SetRequestHeader("accessKey", headData["accessKey"]);
WaitingForServer.Instance.EventWaiting(WaitingForServer.EventName.PhoneCodeRequest);
try
{
await www.SendWebRequest();
WaitingForServer.Instance.EventDone(WaitingForServer.EventName.PhoneCodeRequest);
if (www.result != UnityWebRequest.Result.Success)
{
DebugUtil.LogError(www.downloadHandler.text);