Springboot timing tasks get user information error solution when not logged in

解决org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.

图片报错的信息:No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is an invalid application configuration.
The springboot timing task needs to obtain user information when logging in, so the
In this way, user information cannot be obtained.After adding these two lines of code, the user's information will only be obtained after logging inreference link for reporting errors when obtaining user information directly : https://blog.csdn.net/f1370335844/article/details/96845039

Guess you like

Origin blog.csdn.net/qq_42623440/article/details/113125049