fix(#IXRLO): 重置密码后Reset按钮仍然可用

#Comment
comment #IXRLO

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IXRLO
This commit is contained in:
Argo Zhang 2019-06-11 12:16:05 +08:00
parent 01dfd03a59
commit b48277c426
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 9 additions and 2 deletions

View File

@ -169,14 +169,21 @@ namespace Bootstrap.DataAccess
{
if (!UserChecker(new User { UserName = userName, Password = password })) return false;
if (DictHelper.RetrieveSystemModel() && RetrieveConstUsers().Any(u => userName.Equals(u.UserName, StringComparison.OrdinalIgnoreCase))) return true;
return DbContextManager.Create<User>().ResetPassword(userName, password);
var ret = DbContextManager.Create<User>().ResetPassword(userName, password);
if (ret) CacheCleanUtility.ClearCache(cacheKey: RetrieveUsersDataKey);
return ret;
}
/// <summary>
/// 忘记密码调用
/// </summary>
/// <param name="user"></param>
public static bool ForgotPassword(ResetUser user) => DbContextManager.Create<User>().ForgotPassword(user);
public static bool ForgotPassword(ResetUser user)
{
var ret = DbContextManager.Create<User>().ForgotPassword(user);
if (ret) CacheCleanUtility.ClearCache(cacheKey: RetrieveUsersDataKey);
return ret;
}
/// <summary>
///