Files
EmailBill/WebApi/Controllers/AuthController.cs
SunCheng d052ae5197 fix
2026-02-10 17:49:19 +08:00

24 lines
624 B
C#

using Application;
using Microsoft.AspNetCore.Authorization;
namespace WebApi.Controllers;
[ApiController]
[Route("api/[controller]/[action]")]
public class AuthController(
IAuthApplication authApplication,
ILogger<AuthController> logger) : ControllerBase
{
/// <summary>
/// 用户登录
/// </summary>
[AllowAnonymous]
[HttpPost]
public BaseResponse<Application.Dto.LoginResponse> Login([FromBody] Application.Dto.LoginRequest request)
{
var response = authApplication.Login(request);
logger.LogInformation("用户登录成功");
return response.Ok();
}
}