From 41c673f7f3a8ab40b16f45b905ab5d21733f4f50 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 18 Aug 2019 11:42:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(#I10T9D):=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=90=8D=E7=A7=B0=E4=B8=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment #I10T9D #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I10T9D --- Bootstrap.DataAccess/Helper/UserHelper.cs | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Bootstrap.DataAccess/Helper/UserHelper.cs b/Bootstrap.DataAccess/Helper/UserHelper.cs index 1a67bc50..584fd126 100644 --- a/Bootstrap.DataAccess/Helper/UserHelper.cs +++ b/Bootstrap.DataAccess/Helper/UserHelper.cs @@ -15,23 +15,23 @@ namespace Bootstrap.DataAccess public static class UserHelper { /// - /// + /// 获取所有用户缓存数据键值 /// public const string RetrieveUsersDataKey = "UserHelper-RetrieveUsers"; /// - /// + /// 通过角色ID获取所有用户缓存数据键值 /// public const string RetrieveUsersByRoleIdDataKey = "UserHelper-RetrieveUsersByRoleId"; /// - /// + /// 通过部门ID获取所有用户缓存数据键值 /// public const string RetrieveUsersByGroupIdDataKey = "UserHelper-RetrieveUsersByGroupId"; /// - /// + /// 获取所有新用户缓存数据键值 /// public const string RetrieveNewUsersDataKey = "UserHelper-RetrieveNewUsers"; /// - /// + /// 通过登录名获取登录用户缓存数据键值 /// public const string RetrieveUsersByNameDataKey = DbHelper.RetrieveUsersByNameDataKey; @@ -52,12 +52,12 @@ namespace Bootstrap.DataAccess public static IEnumerable Retrieves() => CacheManager.GetOrAdd(RetrieveUsersDataKey, key => DbContextManager.Create().Retrieves()); /// - /// + /// 认证方法 /// /// /// /// - /// + /// 返回真表示认证通过 public static bool Authenticate(string userName, string password, Action config) { if (!UserChecker(new User { UserName = userName, Password = password })) return false; @@ -124,12 +124,12 @@ namespace Bootstrap.DataAccess if (DictHelper.RetrieveSystemModel() && !string.IsNullOrEmpty(user.Id) && RetrieveConstUsers().Any(u => u.Id == user.Id)) return true; var ret = DbContextManager.Create().Save(user); - if (ret) CacheCleanUtility.ClearCache(userIds: string.IsNullOrEmpty(user.Id) ? new List() : new List() { user.Id }); + if (ret) CacheCleanUtility.ClearCache(userIds: string.IsNullOrEmpty(user.Id) ? new List() : new List() { user.Id }, cacheKey: $"{RetrieveUsersByNameDataKey}*"); return ret; } /// - /// + /// 更新用户方法 /// /// /// @@ -141,12 +141,12 @@ namespace Bootstrap.DataAccess if (DictHelper.RetrieveSystemModel() && RetrieveConstUsers().Any(v => v.Id == id)) return true; var ret = DbContextManager.Create().Update(id, password, displayName); - if (ret) CacheCleanUtility.ClearCache(userIds: string.IsNullOrEmpty(id) ? new List() : new List() { id }); + if (ret) CacheCleanUtility.ClearCache(userIds: string.IsNullOrEmpty(id) ? new List() : new List() { id }, cacheKey: $"{RetrieveUsersByNameDataKey}*"); return ret; } /// - /// + /// 批准新注册用户方法 /// /// /// @@ -159,7 +159,7 @@ namespace Bootstrap.DataAccess } /// - /// + /// 更改密码方法 /// /// /// @@ -202,7 +202,7 @@ namespace Bootstrap.DataAccess } /// - /// + /// 新注册用户拒绝方法 /// /// /// @@ -268,7 +268,7 @@ namespace Bootstrap.DataAccess } /// - /// + /// 保存显示名称方法 /// /// /// @@ -295,7 +295,7 @@ namespace Bootstrap.DataAccess } /// - /// + /// 通过登录名获取登录用户方法 /// /// ///