Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
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
zengtianlai3
ioc_sixiang_license
Commits
02470903
Commit
02470903
authored
Feb 03, 2023
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退给亿迅
parent
8dda7fee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
CorsConfig.java
.../src/main/java/iot/sixiang/license/config/CorsConfig.java
+8
-6
No files found.
license/src/main/java/iot/sixiang/license/config/CorsConfig.java
View file @
02470903
...
@@ -5,7 +5,11 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -5,7 +5,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.*
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
@Configuration
@Configuration
@EnableWebMvc
@EnableWebMvc
...
@@ -24,11 +28,8 @@ public class CorsConfig implements WebMvcConfigurer {
...
@@ -24,11 +28,8 @@ public class CorsConfig implements WebMvcConfigurer {
@Override
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
registry
.
addMapping
(
"/**"
)
// 合并到yx需要添加上白名单
.
allowedOrigins
(
allowedOrigins
)
// .allowedOrigins(allowedOrigins)
.
allowedMethods
(
allowedMethods
)
// .allowedMethods(allowedMethods)
.
allowedOrigins
(
"*"
)
.
allowedMethods
(
"*"
)
.
allowCredentials
(
true
)
.
allowCredentials
(
true
)
.
maxAge
(
3600
)
.
maxAge
(
3600
)
.
allowedHeaders
(
"*"
);
.
allowedHeaders
(
"*"
);
...
@@ -44,4 +45,5 @@ public class CorsConfig implements WebMvcConfigurer {
...
@@ -44,4 +45,5 @@ public class CorsConfig implements WebMvcConfigurer {
registry
.
addInterceptor
(
authenticationInterceptor
)
registry
.
addInterceptor
(
authenticationInterceptor
)
.
addPathPatterns
(
"/**"
);
.
addPathPatterns
(
"/**"
);
}
}
}
}
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