55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Kill.Managers;
|
|
using Kill.Network;
|
|
using Kill.UI.Components;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
namespace Kill.UI.Pages
|
|
{
|
|
public class CheckPasswordPage : MonoBehaviour
|
|
{
|
|
class PasswordRequest
|
|
{
|
|
public string password;
|
|
}
|
|
public InputField passwordInput;
|
|
public Text errorText;
|
|
public GameObject plane;
|
|
public async void OnConfirm()
|
|
{
|
|
LoadingUI.Show();
|
|
string password = passwordInput != null ? passwordInput.text : "";
|
|
if (string.IsNullOrEmpty(password))
|
|
{
|
|
errorText.text = LanguageManager.Instance.GetLanguage("100040");
|
|
return;
|
|
}
|
|
PasswordRequest requestData=new PasswordRequest
|
|
{
|
|
password=passwordInput.text
|
|
};
|
|
|
|
var response = await NetworkCtrl.Instance.Post<LoginResponse>("/api/v1/auth/password/verify", requestData);
|
|
|
|
LoadingUI.Hide();
|
|
|
|
if (response.Data.code == 200)
|
|
{
|
|
plane.SetActive(false);
|
|
gameObject.SetActive(false);
|
|
errorText.text="";
|
|
passwordInput.text="";
|
|
UIManager.Instance.isFirstTime=false;
|
|
}
|
|
else
|
|
{
|
|
errorText.text = LanguageManager.Instance.GetLanguage("100040");
|
|
passwordInput.text="";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|