Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
1b5248b2
Commit
1b5248b2
authored
Dec 16, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跨域
parent
b0f984ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
CorsConfig.java
...m/yifu/cloud/plus/v1/yifu/archives/config/CorsConfig.java
+29
-0
CorsConfig.java
...a/com/yifu.cloud.plus.v1/yifu/auth/config/CorsConfig.java
+29
-0
CorsConfig.java
.../com/yifu/cloud/plus/v1/yifu/admin/config/CorsConfig.java
+29
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/config/CorsConfig.java
0 → 100644
View file @
1b5248b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* Description: 允许跨域以
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
}
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/config/CorsConfig.java
0 → 100644
View file @
1b5248b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* Description: 允许跨域以
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/config/CorsConfig.java
0 → 100644
View file @
1b5248b2
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* Description: 允许跨域以
*
* @author fxju
* @since JDK 1.8
*/
@Slf4j
@Configuration
public
class
CorsConfig
implements
WebMvcConfigurer
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//是否发送Cookie
.
allowCredentials
(
true
)
//放行哪些原始域
.
allowedOriginPatterns
(
"*"
)
.
allowedMethods
(
new
String
[]{
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
})
.
allowedHeaders
(
"*"
)
.
exposedHeaders
(
"*"
);
}
}
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