using YBEE.EQM.Core; namespace YBEE.EQM.Application; /// /// 用户登录认证服务 /// [ApiDescriptionSettings(Name = "sys-auth")] [Route("sys/auth")] public class SysAuthAppService(ISysAuthService authService) : IDynamicApiController { private readonly ISysAuthService _authService = authService; /// /// 账户密码登录 /// /// /// [AllowAnonymous] public async Task LoginByAccount(LoginInput input) { return await _authService.LoginByAccount(input); } /// /// 退出登录 /// /// [AllowAnonymous] public async Task Logout() { await _authService.Logout(); } /// /// 获取当前登录用户信息 /// /// public async Task GetLoginUser() { return await _authService.GetLoginUser(); } /// /// 获取图形验证码 /// /// [AllowAnonymous, DisableOpLog] public async Task GetCaptcha() { return await _authService.GetCaptcha(); } /// /// 校验图形验证码 /// /// /// [AllowAnonymous, DisableOpLog] public async Task VerifyCaptcha(GeneralCaptchaInput input) { return await _authService.VerifyCaptcha(input); } /// /// 获取临时密码 /// /// /// [AllowAnonymous, DisableOpLog] [HttpPost] public List GetTempPassword([Required] List input) { return _authService.GetTempPassword(input); } [AllowAnonymous, DisableOpLog] public string GetPbkdf2(string pwd) { return PBKDF2Encryption.Encrypt(pwd); } [AllowAnonymous, DisableOpLog] public bool ComparePbkdf2(string pwd, string pbpwd) { return PBKDF2Encryption.Compare(pwd, pbpwd); } }