注销账号

This commit is contained in:
杨号敬 2024-12-10 00:51:37 +08:00
parent 22b16bf12f
commit 76212e76f3
7 changed files with 3395 additions and 15 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 164cfa8e6a999134b907eab499328b38
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6085,6 +6085,7 @@ MonoBehaviour:
userNameField: {fileID: 2007997901}
passwordField: {fileID: 2068924169}
verifyCodeField: {fileID: 345431930}
registerusernameField: {fileID: 2007997901}
mmField: {fileID: 2068924169}
qrmmField: {fileID: 259615312}
yqmField: {fileID: 951076517}

View File

@ -16,6 +16,8 @@ public class logoPanel : Base
public InputField userNameField;
public InputField passwordField;
public InputField verifyCodeField;
public InputField registerusernameField;
public InputField mmField;
public InputField qrmmField;
public InputField yqmField;
@ -24,11 +26,13 @@ public class logoPanel : Base
public Button yzmBtn;
public Image regImg;
public GameObject yzm;
public GameObject mm;
public GameObject qrmm;
public GameObject yqm;
public GameObject logBtn;
[Header("µÇ¼°´Å¥")] public Button loginBtn;
public GameObject regbtn;
@ -73,7 +77,7 @@ public class logoPanel : Base
ServerResponse response = JsonUtility.FromJson<ServerResponse>(loginResponse);
if (response.code == 200)
{
SceneManager.LoadScene(1);
OnClickLoginBtnAsync();
}
else
{
@ -86,19 +90,19 @@ public class logoPanel : Base
/// </summary>
public async void OnClickLoginBtnAsync()
{
//loginbody body = new loginbody();
//body.userName = userNameField.text;
//body.password = passwordField.text;
//if (!string.IsNullOrWhiteSpace(verifyCodeField.text))
//{
// body.verifyCode = int.Parse(verifyCodeField.text);
//}
loginbody body = new loginbody
loginbody body = new loginbody();
body.userName = userNameField.text;
body.password = passwordField.text;
if (!string.IsNullOrWhiteSpace(verifyCodeField.text))
{
userName = "15151658596",
//password = "123456",
verifyCode = 111111
};
body.verifyCode = int.Parse(verifyCodeField.text);
}
//loginbody body = new loginbody
//{
// userName = "147258369",
// //password = "123456",
// verifyCode = 111111
//};
string loginResponse = await web.SendRequest(web.URL+"/snail/user/login", "POST", JsonUtility.ToJson(body));
ServerResponse response = JsonUtility.FromJson<ServerResponse>(loginResponse);
if (response != null && response.code == 200 && response.data != null)
@ -113,6 +117,9 @@ public class logoPanel : Base
}
}
private void OnClickRigistBtn()
{
yzm.gameObject.SetActive(true);

View File

@ -0,0 +1,59 @@
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 = "";//测试
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
// 在编辑器模式下停止播放
if (EditorApplication.isPlaying)
{
EditorApplication.isPlaying = false;
}
else
{
Debug.Log("正在测试环境中退出");
}
#else
// 在打包后的环境中退出
Debug.Log("正在打包环境中退出");
Application.Quit();
#endif
}
}
// Update is called once per frame
void Update()
{
}
}

View File

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

View File

@ -28,8 +28,9 @@ public class ShimingPanel : Base
}
void Deregisterclick()
{
{
GameObject cancel = (GameObject)Instantiate(Resources.Load("LLPrefabs/Cancelaccount"), this.transform.parent);
}
void User_AgreementClick()