起因在使用Spring Security的项目中,当用户登录成功后,Spring Security会自动注入UserCredential作为用户的上下文。研究之后,在不使用Spring Security的项目中也实现了类似的效果。
解决方案
2023-04-05