修复登出逻辑
This commit is contained in:
parent
1c4687d832
commit
3ef0b0d112
|
@ -24,13 +24,11 @@ public class Main_interface_Panel : XUIPanel
|
||||||
fanhui_btn = this.transform.Find("UPBG/Back_bton").GetComponent<Button>();
|
fanhui_btn = this.transform.Find("UPBG/Back_bton").GetComponent<Button>();
|
||||||
fanhui_btn.onClick.AddListener(() =>
|
fanhui_btn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
|
UIBootstrap.Instance.OnLogout();
|
||||||
});
|
|
||||||
ShowPanel<View_Panel2>();
|
|
||||||
this.transform.Find("UPBG/Back_bton").GetComponent<Button>().onClick.AddListener(() =>
|
|
||||||
{
|
|
||||||
SceneManager.LoadScene("SampleScene");
|
SceneManager.LoadScene("SampleScene");
|
||||||
});
|
});
|
||||||
|
ShowPanel<View_Panel2>();
|
||||||
|
|
||||||
replay.onClick.AddListener(() => { ReplayPanel(); });
|
replay.onClick.AddListener(() => { ReplayPanel(); });
|
||||||
train.onClick.AddListener(() => { TrainPanel(); });
|
train.onClick.AddListener(() => { TrainPanel(); });
|
||||||
appQuet.onClick.AddListener(() => { Application.Quit();
|
appQuet.onClick.AddListener(() => { Application.Quit();
|
||||||
|
|
|
@ -163,4 +163,17 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
||||||
Debug.Log("OnDestory");
|
Debug.Log("OnDestory");
|
||||||
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnLeaveRoomInfo;
|
AdamSync.SyncCreateRoom.leaveRoomRequset -= OnLeaveRoomInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnLogout()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> replaceInfoDic = new Dictionary<string, string>();
|
||||||
|
replaceInfoDic.Add("login_name", GlobalFlag.currentUser.login_name);
|
||||||
|
StartCoroutine(AsyncWebReq.PostData2(Url_LoginCheck, replaceInfoDic));
|
||||||
|
Debug.Log("OnLogout");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnApplicationQuit()
|
||||||
|
{
|
||||||
|
OnLogout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,9 +79,9 @@ public static class AsyncWebReq
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(request.downloadHandler.text))
|
if (!string.IsNullOrEmpty(request.downloadHandler.text))
|
||||||
action(request.downloadHandler.text);
|
action?.Invoke(request.downloadHandler.text);
|
||||||
else
|
else
|
||||||
action(null);
|
action?.Invoke(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@ public static class InterfaceManager
|
||||||
|
|
||||||
|
|
||||||
#region 接口
|
#region 接口
|
||||||
|
/// <summary>
|
||||||
|
/// 登出接口 Handler/User.ashx?action=exit&login_name=test0001
|
||||||
|
/// </summary>
|
||||||
|
public static string Url_LoginCheck { get => IpAddress + "/Handler/User.ashx?action=exit&"; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 想定Wbe接口
|
/// 想定Wbe接口
|
||||||
|
|
Loading…
Reference in New Issue