|
@@ -30,34 +30,37 @@ public class AuthorizeController {
|
|
private final AuthorizeClient authorizeClient;
|
|
private final AuthorizeClient authorizeClient;
|
|
private final CaptchaSmsHandler captchaSmsHandler;
|
|
private final CaptchaSmsHandler captchaSmsHandler;
|
|
|
|
|
|
- /**
|
|
|
|
- * 发送验证码短信
|
|
|
|
- *
|
|
|
|
- * @param param 手机号参数
|
|
|
|
- * @return 短信会话信息
|
|
|
|
- */
|
|
|
|
- @PostMapping("/sms/captcha")
|
|
|
|
- public SmsSession sendCaptcha(@RequestBody @Valid MobileParam param) {
|
|
|
|
- return this.captchaSmsHandler.send(param.getMobile());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 短信登陆
|
|
* 短信登陆
|
|
*
|
|
*
|
|
* @param param 登陆参数
|
|
* @param param 登陆参数
|
|
* @return 认证信息
|
|
* @return 认证信息
|
|
*/
|
|
*/
|
|
|
|
+ @Authorize(enabled = false)
|
|
@PostMapping("/login/sms")
|
|
@PostMapping("/login/sms")
|
|
public Authorization loginWithSms(@RequestBody @Valid AuthorizeParam.Sms param) {
|
|
public Authorization loginWithSms(@RequestBody @Valid AuthorizeParam.Sms param) {
|
|
return this.authorizeClient.authorize(param);
|
|
return this.authorizeClient.authorize(param);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 发送短信登陆验证码
|
|
|
|
+ *
|
|
|
|
+ * @param param 手机号参数
|
|
|
|
+ * @return 短信会话信息
|
|
|
|
+ */
|
|
|
|
+ @Authorize(enabled = false)
|
|
|
|
+ @PostMapping("/login/sms/captcha")
|
|
|
|
+ public SmsSession sendCaptcha(@RequestBody @Valid MobileParam param) {
|
|
|
|
+ return this.captchaSmsHandler.send(param.getMobile());
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 账号密码登陆
|
|
* 账号密码登陆
|
|
*
|
|
*
|
|
* @param param 登陆参数
|
|
* @param param 登陆参数
|
|
* @return 认证信息
|
|
* @return 认证信息
|
|
*/
|
|
*/
|
|
|
|
+ @Authorize(enabled = false)
|
|
@PostMapping("/login/password")
|
|
@PostMapping("/login/password")
|
|
public Authorization loginWithPassword(@RequestBody @Valid AuthorizeParam.Password param) {
|
|
public Authorization loginWithPassword(@RequestBody @Valid AuthorizeParam.Password param) {
|
|
return this.authorizeClient.authorize(param);
|
|
return this.authorizeClient.authorize(param);
|