Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
springBoot
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
WitCloud
springBoot
Commits
1d4aad74
Commit
1d4aad74
authored
Apr 21, 2017
by
杨伊博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug redirect
parent
9fb9661b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
WebMvcConfig.java
...ity/src/main/java/com/us/example/config/WebMvcConfig.java
+1
-1
WebSecurityConfig.java
...rc/main/java/com/us/example/config/WebSecurityConfig.java
+0
-1
No files found.
springboot-security/src/main/java/com/us/example/config/WebMvcConfig.java
View file @
1d4aad74
...
@@ -12,6 +12,6 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter{
...
@@ -12,6 +12,6 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter{
@Override
@Override
public
void
addViewControllers
(
ViewControllerRegistry
registry
)
{
public
void
addViewControllers
(
ViewControllerRegistry
registry
)
{
registry
.
addViewController
(
"/login"
).
setViewName
(
"login"
);
//
registry.addViewController("/login").setViewName("login");
}
}
}
}
springboot-security/src/main/java/com/us/example/config/WebSecurityConfig.java
View file @
1d4aad74
...
@@ -43,7 +43,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -43,7 +43,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.
anyRequest
().
authenticated
()
//任何请求,登录后可以访问
.
anyRequest
().
authenticated
()
//任何请求,登录后可以访问
.
and
()
.
and
()
.
formLogin
()
.
formLogin
()
.
loginPage
(
"/login"
)
.
failureUrl
(
"/login?error"
)
.
failureUrl
(
"/login?error"
)
.
permitAll
()
//登录页面用户任意访问
.
permitAll
()
//登录页面用户任意访问
.
and
()
.
and
()
...
...
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