修改BUG:忘记密码功能先判断用户是否存在不存在的时候不写入数据库 closed #ITRMN

#Issue
https://gitee.com/LongbowEnterprise/dashboard/issues?id=ITRMN
This commit is contained in:
Argo Zhang 2019-03-18 11:41:48 +08:00
parent c6749fff24
commit 106c77a26c
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
using Bootstrap.DataAccess;
using Bootstrap.DataAccess;
using Longbow.Web.SignalR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@ -55,6 +55,10 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="user"></param>
/// <returns></returns>
[HttpPut]
public bool Put([FromBody]ResetUser user) => UserHelper.ForgotPassword(user);
public bool Put([FromBody]ResetUser user)
{
if (UserHelper.RetrieveUserByUserName(user.UserName) == null) return true;
return UserHelper.ForgotPassword(user);
}
}
}