[前台][登入] 後端程序調整
This commit is contained in:
parent
c9730d1e00
commit
f477fc33d1
@ -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
|
||||||
|
@ -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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user