60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using TMPro;
|
|||
|
using UnityEditor;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class CancelAccount : Base
|
|||
|
{
|
|||
|
public TMP_InputField account;
|
|||
|
public TMP_InputField YanzhengmaInput;
|
|||
|
public Button ConfirmBtn;
|
|||
|
public Button CancelBtn;
|
|||
|
// Start is called before the first frame update
|
|||
|
async void Start()
|
|||
|
{
|
|||
|
RealPlayerInfo realPlayerInfo = new RealPlayerInfo();
|
|||
|
queryPlayerInfo queryPlayerInfo = new queryPlayerInfo();
|
|||
|
realPlayerInfo = await queryPlayerInfo.QueryPlayerInfoPro();
|
|||
|
account.text = "" + realPlayerInfo.data.userName;
|
|||
|
ConfirmBtn.onClick.AddListener(ConfirmClick);
|
|||
|
CancelBtn.onClick.AddListener((() => {Destroy(gameObject);}));
|
|||
|
}
|
|||
|
async void ConfirmClick()
|
|||
|
{
|
|||
|
string response = "";//<2F><><EFBFBD><EFBFBD>
|
|||
|
string body = "{\"verifyCode\":" + int.Parse(YanzhengmaInput.text) + "}";
|
|||
|
Debug.Log(body);
|
|||
|
response = await web.SendRequest(web.URL + "/snail/user/cancel", "POST", body, Global.global.CreateHeaders());
|
|||
|
Debug.Log(response);
|
|||
|
ChangepassRt cpr = JsonConvert.DeserializeObject<ChangepassRt>(response);
|
|||
|
addEventPopUp(cpr.message);
|
|||
|
if (cpr.code == 200)
|
|||
|
{
|
|||
|
Destroy(this.gameObject);
|
|||
|
#if UNITY_EDITOR
|
|||
|
// <20>ڱ༭<DAB1><E0BCAD>ģʽ<C4A3><CABD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
|
|||
|
if (EditorApplication.isPlaying)
|
|||
|
{
|
|||
|
EditorApplication.isPlaying = false;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Debug.Log("<22><><EFBFBD>ڲ<EFBFBD><DAB2>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>");
|
|||
|
}
|
|||
|
#else
|
|||
|
// <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
|
|||
|
Debug.Log("<22><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>");
|
|||
|
Application.Quit();
|
|||
|
#endif
|
|||
|
}
|
|||
|
}
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|