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
d6777cf5
Commit
d6777cf5
authored
Jan 15, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.5' into MVP1.7.5
parents
445579e8
6ac24842
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
42 deletions
+63
-42
CorsConfig.java
...a/com/yifu/cloud/plus/v1/yifu/auth/config/CorsConfig.java
+31
-20
CorsConfig.java
...com/yifu/cloud/plus/v1/yifu/salary/config/CorsConfig.java
+31
-20
TInsuranceUnpurchaseApplyController.java
...alary/controller/TInsuranceUnpurchaseApplyController.java
+0
-1
application.yml
...salary/yifu-salary-biz/src/main/resources/application.yml
+1
-1
No files found.
yifu-auth/src/main/java/com/yifu/cloud/plus/v1/yifu/auth/config/CorsConfig.java
View file @
d6777cf5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @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
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/config/CorsConfig.java
View file @
d6777cf5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
import
java.util.Collections
;
/**
*
Description: 允许跨域以
*
CORS资源共享配置
*
* @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
(
"*"
);
}
public
class
CorsConfig
{
@Bean
public
FilterRegistrationBean
filterRegistrationBean
()
{
CorsConfiguration
corsConfiguration
=
new
CorsConfiguration
();
//1.允许任何来源
corsConfiguration
.
setAllowedOriginPatterns
(
Collections
.
singletonList
(
"*"
));
//2.允许任何请求头
corsConfiguration
.
addAllowedHeader
(
CorsConfiguration
.
ALL
);
//3.允许任何方法
corsConfiguration
.
addAllowedMethod
(
CorsConfiguration
.
ALL
);
//4.允许凭证
corsConfiguration
.
setAllowCredentials
(
true
);
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
corsConfiguration
);
CorsFilter
corsFilter
=
new
CorsFilter
(
source
);
FilterRegistrationBean
<
CorsFilter
>
filterRegistrationBean
=
new
FilterRegistrationBean
<>(
corsFilter
);
filterRegistrationBean
.
setOrder
(-
101
);
// 小于 SpringSecurity Filter的 Order(-100) 即可
return
filterRegistrationBean
;
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TInsuranceUnpurchaseApplyController.java
View file @
d6777cf5
...
...
@@ -33,7 +33,6 @@ import java.util.Map;
* @author huych
* @date 2025-01-10 11:24:38
*/
@CrossOrigin
(
origins
=
"*"
)
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/tinsuranceunpurchaseapply"
)
...
...
yifu-salary/yifu-salary-biz/src/main/resources/application.yml
View file @
d6777cf5
...
...
@@ -50,7 +50,7 @@ security:
-
/salaryEmployeeSelect/getSalaryAccount
# 工资条查询明细通过openId控制
-
/tsalaryatta/ossUploadFile
# 工资条查询附件上传 无token
-
/tsalaryatta/ossFileDelete/**
# 工资条查询附件上传删除 无token
#
- /tinsuranceunpurchaseapply/getAuditPageTemp # 临时调试
-
/tinsuranceunpurchaseapply/getAuditPageTemp
# 临时调试
-
/tinsuranceunpurchaseapply/getAuditCount
# 临时调试
-
/tinsuranceunpurchaseapply/auditTemp
# 临时调试
-
/tauditrecord/getAuditInfoByDomainIdAndAuditType
# 临时调试
...
...
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