From f477fc33d1885a3ed1d3b8914bfec94dc04fee10 Mon Sep 17 00:00:00 2001 From: dev01 Date: Thu, 27 Oct 2022 18:36:09 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=89=8D=E5=8F=B0][=E7=99=BB=E5=85=A5]=20?= =?UTF-8?q?=E5=BE=8C=E7=AB=AF=E7=A8=8B=E5=BA=8F=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/Controllers/LoginController.cs | 4 +++- FrontendWebApi/Models/User.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FrontendWebApi/Controllers/LoginController.cs b/FrontendWebApi/Controllers/LoginController.cs index 2980af9..8b73555 100644 --- a/FrontendWebApi/Controllers/LoginController.cs +++ b/FrontendWebApi/Controllers/LoginController.cs @@ -53,7 +53,7 @@ namespace FrontendWebApi.Controllers [HttpPost] [Route("api/Login")] - public async Task>> Login(Login login) + public async Task>> Login([FromBody] Login login) { ApiResult apiResult = new ApiResult(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 diff --git a/FrontendWebApi/Models/User.cs b/FrontendWebApi/Models/User.cs index d3a9135..5b6426c 100644 --- a/FrontendWebApi/Models/User.cs +++ b/FrontendWebApi/Models/User.cs @@ -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; } } }