重构代码:更改api/Login返回值类型
This commit is contained in:
parent
e7d94c3977
commit
6e1f065271
|
@ -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>
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue