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
d5995151
Commit
d5995151
authored
Jun 25, 2022
by
macro
Browse files
跨域问题解决
parent
7a3da238
Changes
2
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/config/GlobalCorsConfig.java
View file @
d5995151
...
@@ -20,7 +20,7 @@ public class GlobalCorsConfig {
...
@@ -20,7 +20,7 @@ public class GlobalCorsConfig {
public
CorsFilter
corsFilter
()
{
public
CorsFilter
corsFilter
()
{
CorsConfiguration
config
=
new
CorsConfiguration
();
CorsConfiguration
config
=
new
CorsConfiguration
();
//允许所有域名进行跨域调用
//允许所有域名进行跨域调用
config
.
addAllowedOrigin
(
"*"
);
config
.
addAllowedOrigin
Pattern
(
"*"
);
//允许跨越发送cookie
//允许跨越发送cookie
config
.
setAllowCredentials
(
true
);
config
.
setAllowCredentials
(
true
);
//放行全部原始头信息
//放行全部原始头信息
...
...
mall-portal/src/main/java/com/macro/mall/portal/config/GlobalCorsConfig.java
View file @
d5995151
...
@@ -20,7 +20,7 @@ public class GlobalCorsConfig {
...
@@ -20,7 +20,7 @@ public class GlobalCorsConfig {
public
CorsFilter
corsFilter
()
{
public
CorsFilter
corsFilter
()
{
CorsConfiguration
config
=
new
CorsConfiguration
();
CorsConfiguration
config
=
new
CorsConfiguration
();
//允许所有域名进行跨域调用
//允许所有域名进行跨域调用
config
.
addAllowedOrigin
(
"*"
);
config
.
addAllowedOrigin
Pattern
(
"*"
);
//允许跨越发送cookie
//允许跨越发送cookie
config
.
setAllowCredentials
(
true
);
config
.
setAllowCredentials
(
true
);
//放行全部原始头信息
//放行全部原始头信息
...
...
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