Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
f68555e6
Commit
f68555e6
authored
Jan 04, 2019
by
ms-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shiro配置
parent
49d2a620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
ShiroConfig.java
src/main/java/net/mingsoft/config/ShiroConfig.java
+16
-7
No files found.
src/main/java/net/mingsoft/config/ShiroConfig.java
View file @
f68555e6
...
@@ -14,12 +14,21 @@ import org.springframework.context.annotation.Bean;
...
@@ -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 {
...
@@ -63,17 +72,17 @@ public class ShiroConfig {
return
hashedCredentialsMatcher
;
return
hashedCredentialsMatcher
;
}
}
//
@Bean
@Bean
//
public BaseAuthRealm myShiroRealm() {
public
BaseAuthRealm
myShiroRealm
()
{
//
BaseAuthRealm myShiroRealm = new BaseAuthRealm();
BaseAuthRealm
myShiroRealm
=
new
BaseAuthRealm
();
//
myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
myShiroRealm
.
setCredentialsMatcher
(
hashedCredentialsMatcher
());
//
return myShiroRealm;
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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment