From 9c1758e9dc67baae54eb5b5776f5e503a6419ed0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=89=E6=9D=A5=E6=8A=80=E6=9C=AF?= <1490493387@qq.com>
Date: Tue, 12 Oct 2021 23:56:09 +0800
Subject: [PATCH] =?UTF-8?q?style(SmsCodeTokenGranter):=E6=B3=A8=E9=87=8A?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../extension/captcha/CaptchaTokenGranter.java | 2 +-
.../security/extension/mobile/SmsCodeTokenGranter.java | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/youlai-auth/src/main/java/com/youlai/auth/security/extension/captcha/CaptchaTokenGranter.java b/youlai-auth/src/main/java/com/youlai/auth/security/extension/captcha/CaptchaTokenGranter.java
index f82524c6..8caa0946 100644
--- a/youlai-auth/src/main/java/com/youlai/auth/security/extension/captcha/CaptchaTokenGranter.java
+++ b/youlai-auth/src/main/java/com/youlai/auth/security/extension/captcha/CaptchaTokenGranter.java
@@ -16,7 +16,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
- * 验证码授权模式 授权者
+ * 验证码授权模式授权者
*
* @author xianrui
* @date 2021/9/25
diff --git a/youlai-auth/src/main/java/com/youlai/auth/security/extension/mobile/SmsCodeTokenGranter.java b/youlai-auth/src/main/java/com/youlai/auth/security/extension/mobile/SmsCodeTokenGranter.java
index 47e845c9..65f44dd5 100644
--- a/youlai-auth/src/main/java/com/youlai/auth/security/extension/mobile/SmsCodeTokenGranter.java
+++ b/youlai-auth/src/main/java/com/youlai/auth/security/extension/mobile/SmsCodeTokenGranter.java
@@ -14,13 +14,21 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
- * 手机验证码
+ * 手机验证码授权者
*
* @author xianrui
* @date 2021/9/25
*/
public class SmsCodeTokenGranter extends AbstractTokenGranter {
+ /**
+ * 声明授权者 CaptchaTokenGranter 支持授权模式 sms_code
+ * 根据接口传值 grant_type = sms_code 的值匹配到此授权者
+ * 匹配逻辑详见下面的两个方法
+ *
+ * @see org.springframework.security.oauth2.provider.CompositeTokenGranter#grant(String, TokenRequest)
+ * @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#grant(String, TokenRequest)
+ */
private static final String GRANT_TYPE = "sms_code";
private final AuthenticationManager authenticationManager;
--
GitLab