Files
EmailBill/WebApi/Controllers/AuthController.cs

24 lines
624 B
C#
Raw Permalink Normal View History

2026-02-10 17:49:19 +08:00
using Application;
2025-12-25 13:27:23 +08:00
using Microsoft.AspNetCore.Authorization;
namespace WebApi.Controllers;
[ApiController]
[Route("api/[controller]/[action]")]
2026-02-10 17:49:19 +08:00
public class AuthController(
IAuthApplication authApplication,
ILogger<AuthController> logger) : ControllerBase
2025-12-25 13:27:23 +08:00
{
/// <summary>
/// 用户登录
/// </summary>
[AllowAnonymous]
[HttpPost]
2026-02-10 17:49:19 +08:00
public BaseResponse<Application.Dto.LoginResponse> Login([FromBody] Application.Dto.LoginRequest request)
2025-12-25 13:27:23 +08:00
{
2026-02-10 17:49:19 +08:00
var response = authApplication.Login(request);
logger.LogInformation("用户登录成功");
return response.Ok();
2025-12-25 13:27:23 +08:00
}
}