private void CheckLogin() { var token = PropertiesHelper.GetToken(); if (!token.IsLogined || !token.IsValid) { this.ShowLogin(); } }
/// <summary> /// 设置认证信息 /// </summary> /// <param name="token"></param> public static void SetToken(Token token) { PropertiesHelper.SetObject("Token", token); }
/// <summary> /// 获取保存的认证信息 /// </summary> /// <returns></returns> public static Token GetToken() { var token = PropertiesHelper.GetObject <Token>("Token"); return(token ?? new Token()); }