[前台][登入] 後端程序調整
This commit is contained in:
parent
c9730d1e00
commit
f477fc33d1
@ -53,7 +53,7 @@ namespace FrontendWebApi.Controllers
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/Login")]
|
||||
public async Task<ActionResult<ApiResult<TnToken>>> Login(Login login)
|
||||
public async Task<ActionResult<ApiResult<TnToken>>> Login([FromBody] Login login)
|
||||
{
|
||||
ApiResult<TnToken> apiResult = new ApiResult<TnToken>(null);
|
||||
ErrorCode errorCode = new ErrorCode();
|
||||
@ -67,6 +67,7 @@ namespace FrontendWebApi.Controllers
|
||||
if (User == null)
|
||||
{
|
||||
apiResult.Code = "9998";
|
||||
apiResult.Msg = "查無此帳戶";
|
||||
return Ok(apiResult);
|
||||
}
|
||||
JwtLogin jwtLoing = new JwtLogin()
|
||||
@ -77,6 +78,7 @@ namespace FrontendWebApi.Controllers
|
||||
userinfo_guid = User.userinfo_guid
|
||||
};
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Msg = "登入成功";
|
||||
apiResult.Data = jwt.GenerateToken(jwtLoing);
|
||||
}
|
||||
catch
|
||||
|
@ -19,6 +19,6 @@ namespace FrontendWebApi.Models
|
||||
public class Login
|
||||
{
|
||||
public string account { get; set; }
|
||||
//public string password { get; set; }
|
||||
public string password { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user