9/06更新
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
### 简介:
|
||||
**中文:意框架**(和他的名字一样“简易”)
|
||||
|
||||
正在持续更进业务模块
|
||||
模块分化较多,可根据业务自行引用或抛弃,集大成者,大而全乎,也许你能从中学习到一些独特见解
|
||||
|
||||
正在持续更进业务模块,正在接入ruoyi
|
||||
|
||||
**英文:YiFramework**
|
||||
|
||||
|
||||
@@ -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<MenuEntity> menus)
|
||||
public string GetAccessToken(UserEntity user, HashSet<MenuEntity> menus)
|
||||
{
|
||||
return this.GetToken(_JWTTokenOptions.Expiration, user, menus);
|
||||
}
|
||||
|
||||
private string GetToken(int minutes, UserEntity user, HashSet<MenuEntity> menus,bool isRefresh = false)
|
||||
private string GetToken(int minutes, UserEntity user, HashSet<MenuEntity> menus, bool isRefresh = false)
|
||||
{
|
||||
List<Claim> claims = new List<Claim>();
|
||||
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)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Yi.Framework.Service
|
||||
}
|
||||
public async Task<bool> Exist(string userName, Action<UserEntity> 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);
|
||||
|
||||
Reference in New Issue
Block a user