完善权限

This commit is contained in:
chenchun
2022-05-05 17:04:49 +08:00
parent 3994f14010
commit 5c1b91f348
2 changed files with 5 additions and 5 deletions

View File

@@ -41,8 +41,8 @@ namespace Yi.Framework.WebCore.AttributeExtend
var perList = context.HttpContext.User.Claims.Where(u => u.Type == "permission").Select(u=> u.Value.ToString().ToLower()). ToList();
//判断权限是否存在Redis中,或者jwt中
//进行正则表达式的匹配
Regex regex = new Regex($"{permission.ToLower()}");
//进行正则表达式的匹配以code开头
Regex regex = new Regex($"^{permission.ToLower()}");
foreach (var p in perList)
{
if (regex.IsMatch(p))