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

View File

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