Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
9a23fd81
Commit
9a23fd81
authored
Dec 15, 2021
by
macro
Browse files
Update SecurityConfig.java
parent
360990fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
mall-security/src/main/java/com/macro/mall/security/config/SecurityConfig.java
View file @
9a23fd81
...
...
@@ -31,14 +31,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
protected
void
configure
(
HttpSecurity
httpSecurity
)
throws
Exception
{
ExpressionUrlAuthorizationConfigurer
<
HttpSecurity
>.
ExpressionInterceptUrlRegistry
registry
=
httpSecurity
.
authorizeRequests
();
//不需要保护的资源路径允许访问
//
不需要保护的资源路径允许访问
for
(
String
url
:
ignoreUrlsConfig
().
getUrls
())
{
registry
.
antMatchers
(
url
).
permitAll
();
}
//允许跨域
请求
的OPTIONS请求
//
允许跨域的OPTIONS请求
registry
.
antMatchers
(
HttpMethod
.
OPTIONS
)
.
permitAll
();
// 任何请求需要身份认证
//
其他
任何请求
都
需要身份认证
registry
.
and
()
.
authorizeRequests
()
.
anyRequest
()
...
...
Write
Preview
Supports
Markdown
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