SysAuthAppService.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 用户登录认证服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "sys-auth")]
  7. [Route("sys/auth")]
  8. public class SysAuthAppService : IDynamicApiController
  9. {
  10. private readonly ISysAuthService _authService;
  11. public SysAuthAppService(ISysAuthService authService)
  12. {
  13. _authService = authService;
  14. }
  15. /// <summary>
  16. /// 账户密码登录
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. [AllowAnonymous]
  21. public async Task<AuthOutput> LoginByAccount(LoginInput input)
  22. {
  23. return await _authService.LoginByAccount(input);
  24. }
  25. /// <summary>
  26. /// 退出登录
  27. /// </summary>
  28. /// <returns></returns>
  29. [AllowAnonymous]
  30. public async Task Logout()
  31. {
  32. await _authService.Logout();
  33. }
  34. /// <summary>
  35. /// 获取当前登录用户信息
  36. /// </summary>
  37. /// <returns></returns>
  38. public async Task<LoginOutput> GetLoginUser()
  39. {
  40. return await _authService.GetLoginUser();
  41. }
  42. /// <summary>
  43. /// 获取图形验证码
  44. /// </summary>
  45. /// <returns></returns>
  46. [AllowAnonymous]
  47. [DisableOpLog]
  48. public async Task<GeneralCaptchaOutput> GetCaptcha()
  49. {
  50. return await _authService.GetCaptcha();
  51. }
  52. /// <summary>
  53. /// 校验图形验证码
  54. /// </summary>
  55. /// <param name="input"></param>
  56. /// <returns></returns>
  57. [AllowAnonymous]
  58. [DisableOpLog]
  59. public async Task<GeneralCaptchaOutput> VerifyCaptcha(GeneralCaptchaInput input)
  60. {
  61. return await _authService.VerifyCaptcha(input);
  62. }
  63. }