Merge pull request #12682 from dataease/pr@dev-v2@perf_token

perf(X-Pack): 优化社区版token验证机制
This commit is contained in:
fit2cloud-chenyw 2024-10-14 11:59:31 +08:00 committed by GitHub
commit abfae548be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit 08cc93e3fb3dc9579759a738dad6a1726577f026
Subproject commit 7c95eb9a2cd5c13e7c06e92b72b36c14db6d0d3c

View File

@ -40,9 +40,9 @@ public class CommunityTokenFilter implements Filter {
String pwd = SubstituleLoginConfig.getPwd();
secret = Md5Utils.md5(pwd);
} else {
Object apisixTokenManage = CommonBeanFactory.getBean("apisixTokenManage");
Method method = DeReflectUtil.findMethod(apisixTokenManage.getClass(), "userCacheBO");
Object o = ReflectionUtils.invokeMethod(method, apisixTokenManage, userId);
Object apisixCacheManage = CommonBeanFactory.getBean("apisixCacheManage");
Method method = DeReflectUtil.findMethod(apisixCacheManage.getClass(), "userCacheBO");
Object o = ReflectionUtils.invokeMethod(method, apisixCacheManage, userId);
Method pwdMethod = DeReflectUtil.findMethod(o.getClass(), "getPwd");
Object pwdObj = ReflectionUtils.invokeMethod(pwdMethod, o);
secret = pwdObj.toString();