//
namespace SafeCampus.Web.Core;
///
/// B端登录控制器
///
[ApiDescriptionSettings(Tag = "B端权限校验")]
[Route("sys/auth/b")]
public class AuthBController : BaseController
{
private readonly IAuthService _authService;
public AuthBController(IAuthService authService)
{
_authService = authService;
}
///
/// B端获取图片验证码
///
///
[HttpGet("getPicCaptcha")]
[AllowAnonymous]
public async Task GetPicCaptcha()
{
return await _authService.GetCaptchaInfo();
}
///
/// B端获取手机验证码
///
///
///
[HttpGet("getPhoneValidCode")]
[AllowAnonymous]
public async Task GetPhoneValidCode([FromQuery] GetPhoneValidCodeInput input)
{
return await _authService.GetPhoneValidCode(input, LoginClientTypeEnum.B);
}
///
/// B端登录
///
///
///
[AllowAnonymous]
[HttpPost("login")]
[DisplayName(EventSubscriberConst.LOGIN_B)]
public async Task Login(LoginInput input)
{
return await _authService.Login(input, LoginClientTypeEnum.B);
}
///
/// B端手机号登录
///
///
///
[AllowAnonymous]
[HttpPost("loginByPhone")]
public async Task LoginByPhone(LoginByPhoneInput input)
{
return await _authService.LoginByPhone(input, LoginClientTypeEnum.B);
}
///
/// 登出
///
///
[HttpPost("logout")]
[DisplayName(EventSubscriberConst.LOGIN_OUT_B)]
public async Task LoginOut([FromBody] LoginOutInput input)
{
await _authService.LoginOut(input.Token, LoginClientTypeEnum.B);
}
///
/// 获取用户信息
///
///
[HttpGet("getLoginUser")]
public async Task GetLoginUser()
{
return await _authService.GetLoginUser();
}
}