|
@@ -14,12 +14,21 @@ import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
|
|
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
|
|
|
|
|
|
|
|
|
|
+import com.mingsoft.basic.configurer.ShiroTagFreeMarkderConfigurer;
|
|
|
|
|
+
|
|
|
|
|
+import net.mingsoft.basic.security.BaseAuthRealm;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
|
public class ShiroConfig {
|
|
public class ShiroConfig {
|
|
|
|
|
|
|
|
@Value("managerPath")
|
|
@Value("managerPath")
|
|
|
private String managerPath;
|
|
private String managerPath;
|
|
|
|
|
+
|
|
|
|
|
+ @Bean
|
|
|
|
|
+ public ShiroTagFreeMarkderConfigurer freemarkerConfig() {
|
|
|
|
|
+ return new ShiroTagFreeMarkderConfigurer();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Bean
|
|
@Bean
|
|
|
public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
|
|
public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
|
|
@@ -63,17 +72,17 @@ public class ShiroConfig {
|
|
|
return hashedCredentialsMatcher;
|
|
return hashedCredentialsMatcher;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Bean
|
|
|
|
|
-// public BaseAuthRealm myShiroRealm() {
|
|
|
|
|
-// BaseAuthRealm myShiroRealm = new BaseAuthRealm();
|
|
|
|
|
-// myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
|
|
|
|
|
-// return myShiroRealm;
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ @Bean
|
|
|
|
|
+ public BaseAuthRealm myShiroRealm() {
|
|
|
|
|
+ BaseAuthRealm myShiroRealm = new BaseAuthRealm();
|
|
|
|
|
+ myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
|
|
|
|
|
+ return myShiroRealm;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Bean
|
|
@Bean
|
|
|
public SecurityManager securityManager() {
|
|
public SecurityManager securityManager() {
|
|
|
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
|
|
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
|
|
|
- //securityManager.setRealm(myShiroRealm());
|
|
|
|
|
|
|
+ securityManager.setRealm(myShiroRealm());
|
|
|
return securityManager;
|
|
return securityManager;
|
|
|
}
|
|
}
|
|
|
|
|
|