Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureInvokeAspect基本类型或泛型无法反射成功 #171

Open
LiJun990105 opened this issue Apr 12, 2024 · 0 comments
Open

SecureInvokeAspect基本类型或泛型无法反射成功 #171

LiJun990105 opened this issue Apr 12, 2024 · 0 comments

Comments

@LiJun990105
Copy link

LiJun990105 commented Apr 12, 2024

SecureInvokeAspect里面的 List parameters = Stream.of(method.getParameterTypes()).map(Class::getName).collect(Collectors.toList());
Class::getName如果是基本类型,则后面无法反射Class.forName成功,需要包装下成包装类型,可以参考hutool的
List parameters =
Stream.of(method.getParameterTypes())
.map(type -> BasicType.wrap(type).getName())
.collect(Collectors.toList());

泛型这个没有找到很好的解决方案

还有加了这个顺序后@order(Ordered.HIGHEST_PRECEDENCE + 1)//确保最先执行,因为spring事务优先级是比较低的,可能
TransactionSynchronizationManager.isActualTransactionActive();返回false,从而无法执行后续代码

@LiJun990105 LiJun990105 changed the title SecureInvokeAspect基本类型无法反射成功 SecureInvokeAspect基本类型或泛型无法反射成功 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant