From 9ed2f1a91188b0df68210c784bb1ff7134acfba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=93=AE?= <834207172@qq.com> Date: Wed, 24 Sep 2025 15:58:54 +0800 Subject: [PATCH] 1 --- .../Runtime/Tool/WebRequest/WebRequestSystem.cs | 14 ++++++++++++++ Assets/00.StaryEvo/package.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) 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",