[前台][登入] 後端程序調整

This commit is contained in:
dev01 2022-10-27 18:36:09 +08:00
parent c9730d1e00
commit f477fc33d1
2 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace FrontendWebApi.Controllers
[HttpPost] [HttpPost]
[Route("api/Login")] [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); ApiResult<TnToken> apiResult = new ApiResult<TnToken>(null);
ErrorCode errorCode = new ErrorCode(); ErrorCode errorCode = new ErrorCode();
@ -67,6 +67,7 @@ namespace FrontendWebApi.Controllers
if (User == null) if (User == null)
{ {
apiResult.Code = "9998"; apiResult.Code = "9998";
apiResult.Msg = "查無此帳戶";
return Ok(apiResult); return Ok(apiResult);
} }
JwtLogin jwtLoing = new JwtLogin() JwtLogin jwtLoing = new JwtLogin()
@ -77,6 +78,7 @@ namespace FrontendWebApi.Controllers
userinfo_guid = User.userinfo_guid userinfo_guid = User.userinfo_guid
}; };
apiResult.Code = "0000"; apiResult.Code = "0000";
apiResult.Msg = "登入成功";
apiResult.Data = jwt.GenerateToken(jwtLoing); apiResult.Data = jwt.GenerateToken(jwtLoing);
} }
catch catch

View File

@ -19,6 +19,6 @@ namespace FrontendWebApi.Models
public class Login public class Login
{ {
public string account { get; set; } public string account { get; set; }
//public string password { get; set; } public string password { get; set; }
} }
} }