diff --git a/README.md b/README.md index c210d325..1e7558e4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ ### 简介: **中文:意框架**(和他的名字一样“简易”) -正在持续更进业务模块 +模块分化较多,可根据业务自行引用或抛弃,集大成者,大而全乎,也许你能从中学习到一些独特见解 + +正在持续更进业务模块,正在接入ruoyi **英文:YiFramework** diff --git a/Yi.Framework.Net6/Yi.Framework.Core/JwtInvoker.cs b/Yi.Framework.Net6/Yi.Framework.Core/JwtInvoker.cs index b7ddc280..de101ab4 100644 --- a/Yi.Framework.Net6/Yi.Framework.Core/JwtInvoker.cs +++ b/Yi.Framework.Net6/Yi.Framework.Core/JwtInvoker.cs @@ -23,15 +23,15 @@ namespace Yi.Framework.Core } public string GetRefreshToken(UserEntity user) { - return this.GetToken(_JWTTokenOptions.ReExpiration, user,null, true); + return this.GetToken(_JWTTokenOptions.ReExpiration, user, null, true); } - public string GetAccessToken(UserEntity user,HashSet menus) + public string GetAccessToken(UserEntity user, HashSet menus) { return this.GetToken(_JWTTokenOptions.Expiration, user, menus); } - private string GetToken(int minutes, UserEntity user, HashSet menus,bool isRefresh = false) + private string GetToken(int minutes, UserEntity user, HashSet menus, bool isRefresh = false) { List claims = new List(); claims.Add(new Claim(JwtRegisteredClaimNames.Nbf, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}")); @@ -42,7 +42,10 @@ namespace Yi.Framework.Core foreach (var m in menus) { - claims.Add(new Claim("permission", m.PermissionCode.ToString())); + if (!string.IsNullOrEmpty(m.PermissionCode)) + { + claims.Add(new Claim("permission", m.PermissionCode.ToString())); + } } if (isRefresh) diff --git a/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs b/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs index 16fecb33..3e24bcde 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs @@ -30,7 +30,7 @@ namespace Yi.Framework.Service } public async Task Exist(string userName, Action userAction = null) { - var user = await _repository.GetFirstAsync(u => u.UserName == userName); + var user = await _repository.GetFirstAsync(u => u.UserName == userName&& u.IsDeleted==false); if (userAction != null) { userAction.Invoke(user);