重构代码:更改api/Login返回值类型

This commit is contained in:
Argo-MacBookPro 2018-10-18 11:16:02 +08:00
parent e7d94c3977
commit 6e1f065271
1 changed files with 3 additions and 4 deletions

View File

@ -21,17 +21,16 @@ namespace Bootstrap.Admin.Controllers.Api
/// <returns></returns>
[AllowAnonymous]
[HttpPost]
public ActionResult Post([FromBody]JObject value)
public string Post([FromBody]JObject value)
{
dynamic user = value;
string userName = user.userName;
string password = user.password;
if (BootstrapUser.Authenticate(userName, password))
{
var token = BootstrapAdminJwtTokenHandler.CreateToken(userName);
return new JsonResult(new { token });
return BootstrapAdminJwtTokenHandler.CreateToken(userName);
}
return new NoContentResult();
return null;
}
/// <summary>
///