Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
97834835
Commit
97834835
authored
Jun 28, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改网关跨域
parent
6915ec9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
5 deletions
+13
-5
base-manager/src/main/java/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
...a/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
+2
-2
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AuthFilter.java
...ava/com/mortals/xhx/base/framework/filter/AuthFilter.java
+1
-1
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/BlackListUrlFilter.java
...mortals/xhx/base/framework/filter/BlackListUrlFilter.java
+1
-1
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/GlobalLogFilter.java
...om/mortals/xhx/base/framework/filter/GlobalLogFilter.java
+1
-1
smart-gateway/src/main/resources/bootstrap.yml
smart-gateway/src/main/resources/bootstrap.yml
+8
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/framework/aspect/WebLogAspect.java
View file @
97834835
...
...
@@ -68,8 +68,8 @@ public class WebLogAspect {
String
startTime
=
map
.
getOrDefault
(
"startTime"
,
String
.
valueOf
(
System
.
currentTimeMillis
()));
long
takeTime
=
(
System
.
currentTimeMillis
()
-
Long
.
parseLong
(
startTime
));
log
.
info
(
" \n 请求路径:{}
\n
耗时:{}ms \n 请求报文:{} \n 响应报文:{}"
,
request
.
getRequestURI
(),
takeTime
,
map
.
getOrDefault
(
"req"
,
""
),
result
==
null
?
""
:
result
.
toString
(
));
log
.
info
(
" \n 请求路径:{} 耗时:{}ms \n 请求报文:{} \n 响应报文:{}"
,
request
.
getRequestURI
(),
takeTime
,
map
.
getOrDefault
(
"req"
,
""
),
result
==
null
?
""
:
JSON
.
toJSONString
(
result
));
}
}
...
...
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AuthFilter.java
View file @
97834835
...
...
@@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration;
* @author: zxfei
* @date: 2022/6/17 15:18
*/
@Configuration
//
@Configuration
public
class
AuthFilter
{
/**
...
...
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/BlackListUrlFilter.java
View file @
97834835
...
...
@@ -16,7 +16,7 @@ import java.util.regex.Pattern;
* @author: zxfei
* @date: 2022/6/20 16:49
*/
@Component
//
@Component
public
class
BlackListUrlFilter
extends
AbstractGatewayFilterFactory
<
BlackListUrlFilter
.
Config
>
{
@Override
public
GatewayFilter
apply
(
Config
config
)
{
...
...
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/GlobalLogFilter.java
View file @
97834835
...
...
@@ -32,7 +32,7 @@ import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.G
* @date: 2022/6/20 17:00
*/
@Slf4j
@Component
//
@Component
public
class
GlobalLogFilter
implements
GlobalFilter
,
Ordered
{
@Autowired
...
...
smart-gateway/src/main/resources/bootstrap.yml
View file @
97834835
...
...
@@ -16,6 +16,14 @@ spring:
cloud
:
# 网关配置
gateway
:
globalcors
:
cors-configurations
:
'
[/**]'
:
allowedOrigins
:
"
*"
allowedHeaders
:
"
*"
allowedMethods
:
"
*"
default-filters
:
-
DedupeResponseHeader=Vary Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST
httpclient
:
connect-timeout
:
1000
response-timeout
:
5s
...
...
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