diff --git a/Assets/00.StaryEvo/Runtime/Tool/WebRequest/WebRequestSystem.cs b/Assets/00.StaryEvo/Runtime/Tool/WebRequest/WebRequestSystem.cs index 49c08c7..753da37 100644 --- a/Assets/00.StaryEvo/Runtime/Tool/WebRequest/WebRequestSystem.cs +++ b/Assets/00.StaryEvo/Runtime/Tool/WebRequest/WebRequestSystem.cs @@ -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 Login(string url, string username, string password) @@ -64,7 +69,12 @@ namespace Stary.Evo JsonConvert.DeserializeObject(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 /// public static async Task GetValidateToken(string url) { +#if UNITY_EDITOR authorization = EditorPrefs.GetString("Authorization"); +#else + authorization = PlayerPrefs.GetString("Authorization"); +#endif try { diff --git a/Assets/00.StaryEvo/package.json b/Assets/00.StaryEvo/package.json index 44e16f6..f1f9f30 100644 --- a/Assets/00.StaryEvo/package.json +++ b/Assets/00.StaryEvo/package.json @@ -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",