This commit is contained in:
2025-09-24 15:58:54 +08:00
parent 4233d2a78f
commit 9ed2f1a911
2 changed files with 15 additions and 1 deletions

View File

@@ -18,7 +18,12 @@ namespace Stary.Evo
static WebRequestSystem()
{
#if UNITY_EDITOR
authorization = EditorPrefs.GetString("Authorization");
#else
authorization = PlayerPrefs.GetString("Authorization");
#endif
}
public static async Task<bool> Login(string url, string username, string password)
@@ -64,7 +69,12 @@ namespace Stary.Evo
JsonConvert.DeserializeObject<AuthenticationResponse>(authResponse.data.ToString());
Debug.Log("UnityEvo:AuthenticationResponse" + authResponseData.Token);
authorization = authResponseData.Token;
#if UNITY_EDITOR
EditorPrefs.SetString("Authorization", authorization);
#else
PlayerPrefs.SetString("Authorization",authorization);
#endif
Debug.Log("UnityEvo:登录成功");
return true;
}
@@ -87,7 +97,11 @@ namespace Stary.Evo
/// <returns></returns>
public static async Task<bool> GetValidateToken(string url)
{
#if UNITY_EDITOR
authorization = EditorPrefs.GetString("Authorization");
#else
authorization = PlayerPrefs.GetString("Authorization");
#endif
try
{

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.main",
"version": "2.0.7",
"version": "2.0.8",
"displayName": "00.StaryEvo",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",