public string GetAdminTokenByAdminName(string administratorName) { if (string.IsNullOrEmpty(administratorName)) { return(null); } var administratorToken = new AdministratorToken() { AdministratorName = administratorName, AddDate = DateTime.Now }; return(JsonWebToken.Encode(administratorToken, WebConfigUtils.SecretKey, JwtHashAlgorithm.HS256)); }
public static string GetAdministratorTokenStr(string administratorName) { if (string.IsNullOrEmpty(administratorName)) { return(null); } var administratorToken = new AdministratorToken() { AdministratorName = administratorName, AddDate = DateTime.Now }; return(JsonWebToken.Encode(administratorToken, FileConfigManager.Instance.SecretKey, JwtHashAlgorithm.HS256)); }