修改BUG:Login Web api对post数据进行检查后再传入Authenticate方法

This commit is contained in:
Argo-MacBookPro 2018-10-24 17:57:31 +08:00
parent 8a38d58aef
commit 68b5009e97
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ namespace Bootstrap.Admin.Controllers.Api
dynamic user = value;
string userName = user.userName;
string password = user.password;
if (UserHelper.Authenticate(userName, password))
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password) && UserHelper.Authenticate(userName, password))
{
return BootstrapAdminJwtTokenHandler.CreateToken(userName);
}