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
2 changed files with 4 additions and 4 deletions

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();