1
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user