Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
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
gavelinfo
kwell-mes
Commits
9e9bb8cd
Commit
9e9bb8cd
authored
Apr 06, 2022
by
zhoumaotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config调整
parent
c30b95e5
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
228 additions
and
128 deletions
+228
-128
FilterConfig.java
gavel/src/main/java/com/gavel/kwell/config/FilterConfig.java
+26
-26
ShiroConfig.java
gavel/src/main/java/com/gavel/kwell/config/ShiroConfig.java
+202
-102
No files found.
gavel/src/main/java/com/gavel/kwell/config/FilterConfig.java
View file @
9e9bb8cd
package
com
.
gavel
.
kwell
.
config
;
import
java.util.Arrays
;
import
com.gavel.framework.filter.RequestWrapperFilter
;
import
com.gavel.framework.filter.ThreadContextFilter
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.filter.CharacterEncodingFilter
;
import
com.gavel.framework.filter.AuthenticationFilter
;
import
com.gavel.framework.filter.RequestWrapperFilter
;
import
com.gavel.framework.filter.ThreadContextFilter
;
import
java.util.Arrays
;
@Configuration
public
class
FilterConfig
{
...
...
@@ -22,21 +22,21 @@ public class FilterConfig {
return
filter
;
}
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
@Bean
public
FilterRegistrationBean
authenticationFilter
()
{
// 用户认证
AuthenticationFilter
authenticationFilter
=
new
AuthenticationFilter
();
FilterRegistrationBean
registrationBean
=
new
FilterRegistrationBean
();
registrationBean
.
setName
(
"authenticationFilter"
);
// 过滤器名称
registrationBean
.
setFilter
(
authenticationFilter
);
// 注入过滤器
registrationBean
.
setOrder
(
10
);
registrationBean
.
addInitParameter
(
"prefix"
,
"/css,/js,/images,/lib,/fonts,/mock"
);
registrationBean
.
setUrlPatterns
(
Arrays
.
asList
(
"/*"
));
//拦截规则
return
registrationBean
;
}
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
// @Bean
// public FilterRegistrationBean authenticationFilter() {
// // 用户认证
// AuthenticationFilter authenticationFilter = new AuthenticationFilter();
// FilterRegistrationBean registrationBean = new FilterRegistrationBean();
// registrationBean.setName("authenticationFilter"); // 过滤器名称
// registrationBean.setFilter(authenticationFilter); // 注入过滤器
// registrationBean.setOrder(10);
// registrationBean.addInitParameter("prefix", "/css,/js,/images,/lib,/fonts,/mock");
// registrationBean.setUrlPatterns(Arrays.asList("/*")); //拦截规则
// return registrationBean;
// }
@Bean
public
FilterRegistrationBean
requestWrapperFilter
()
{
RequestWrapperFilter
requestWrapperFilter
=
new
RequestWrapperFilter
();
...
...
gavel/src/main/java/com/gavel/kwell/config/ShiroConfig.java
View file @
9e9bb8cd
This diff is collapsed.
Click to expand it.
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