使用shiro报错--One or more realms must be present to execute an authentication attempt. One or more realms must be present to execute an authentication attempt.
必须存在一个或多个领域执行身份验证。必须存在一个或多个领域执行身份验证。
在配置SecurityManager的bean的时候,没有设置Realm域
@Bean
public SecurityManager securityManager(){
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
//设置realm,这里不设置的话会报错
//One or more realms must be present to execute an authentication attempt. One or more realms must be present to execute an authentication attempt.
securityManager.setRealm(myShiroRealm());
return securityManager;
}