_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/lianghaoLL/Change_Password.cs

48 lines
1.3 KiB
C#
Raw Normal View History

2024-11-27 16:15:31 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
2024-12-09 23:16:39 +08:00
using Newtonsoft.Json;
2024-11-27 16:15:31 +08:00
public class Change_Password : Base
{
public TMP_InputField PhonenumberInput;
public TMP_InputField YanzhengmaInput;
public TMP_InputField NewPasswordInput;
public Button ConfirmBtn;
public ShimingPanel shimingPanel;
// Start is called before the first frame update
void Start()
{
ConfirmBtn.onClick.AddListener(ConfirmClick);
PhonenumberInput.placeholder.GetComponent<TextMeshProUGUI>().text = shimingPanel.phonenumber.text;
}
async void ConfirmClick()
{
string response = "";//<2F><><EFBFBD><EFBFBD>
string body = "{\"password\":\"" +NewPasswordInput.text + "\",\"verifyCode\":" + int.Parse(YanzhengmaInput.text) + "}";
Debug.Log(body);
response = await web.SendRequest(web.URL + "/snail/user/changePassword", "POST", body, Global.global.CreateHeaders());
2024-11-27 16:15:31 +08:00
Debug.Log(response);
2024-12-09 23:16:39 +08:00
ChangepassRt cpr= JsonConvert.DeserializeObject<ChangepassRt>(response);
addEventPopUp(cpr.message);
if (cpr.code == 200)
{
Destroy(this.gameObject);
}
}
2024-11-27 16:15:31 +08:00
// Update is called once per frame
void Update()
{
2024-12-09 23:16:39 +08:00
2024-11-27 16:15:31 +08:00
}
}
2024-12-09 23:16:39 +08:00
public class ChangepassRt : Response
{
}