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
243d9f4e
Commit
243d9f4e
authored
Mar 27, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
06d7ba46
c1216348
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
24 deletions
+61
-24
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
...m/mortals/xhx/module/app/service/impl/AppServiceImpl.java
+25
-8
base-manager/src/test/java/com/mortals/httpclient/system/system.http
...r/src/test/java/com/mortals/httpclient/system/system.http
+22
-0
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
...om/mortals/xhx/base/framework/filter/AccessLogFilter.java
+9
-12
smart-gateway/src/main/resources/bootstrap.yml
smart-gateway/src/main/resources/bootstrap.yml
+4
-4
smart-gateway/src/main/resources/logback-spring.xml
smart-gateway/src/main/resources/logback-spring.xml
+1
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppServiceImpl.java
View file @
243d9f4e
...
...
@@ -115,22 +115,39 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
String
domainUrl
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
params
.
getServerName
())
&&
Validator
.
isIpv4
(
params
.
getServerName
()))
{
domainUrl
=
UrlBuilder
.
ofHttp
(
params
.
getServerName
()).
setPort
(
params
.
getServerPort
()
>
0
?
params
.
getServerPort
()
:
11078
).
build
();
domainUrl
=
StrUtil
.
sub
(
domainUrl
,
0
,
domainUrl
.
length
()
-
1
);
}
else
{
// domainUrl = GlobalSysInfo.getParamValue(Constant.PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
domainUrl
=
""
;
}
if
(!
ObjectUtils
.
isEmpty
(
siteEntity
))
{
//请求地址 http://domian/app/siteCode/appcode/html
item
.
setCustUrl
(
UrlBuilder
.
ofHttp
(
params
.
getServerName
()).
setPort
(
params
.
getServerPort
()
>
0
?
params
.
getServerPort
()
:
11078
)
if
(!
ObjectUtils
.
isEmpty
(
domainUrl
)){
item
.
setCustUrl
(
UrlBuilder
.
ofHttp
(
domainUrl
)
.
addPath
(
CUSTAPP_ROOT_PATH
)
.
addPath
(
siteEntity
.
getSiteCode
())
.
addPath
(
item
.
getAppCode
())
.
addPath
(
item
.
getVersion
().
toString
())
.
build
());
}
else
{
item
.
setCustUrl
(
CUSTAPP_ROOT_PATH
+
"/"
+
siteEntity
.
getSiteCode
()+
"/"
+
item
.
getAppCode
()+
"/"
+
item
.
getVersion
());
}
}
else
{
item
.
setCustUrl
(
""
);
}
//构建图标地址
item
.
setAppIconUrl
(
UrlBuilder
.
ofHttp
(
params
.
getServerName
()).
setPort
(
params
.
getServerPort
()
>
0
?
params
.
getServerPort
()
:
11078
)
if
(!
ObjectUtils
.
isEmpty
(
domainUrl
)){
item
.
setAppIconUrl
(
UrlBuilder
.
ofHttp
(
domainUrl
)
.
addPath
(
item
.
getAppIconPath
()).
build
());
}
else
{
item
.
setAppIconUrl
(
item
.
getAppIconPath
());
}
});
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
}
...
...
base-manager/src/test/java/com/mortals/httpclient/system/system.http
View file @
243d9f4e
...
...
@@ -53,6 +53,28 @@ Content-Type: application/json
"url":"http://172.15.28.113:8900"
}
###参数信息更新与保存
POST {{baseUrl}}/param/save
Authorization: {{authToken}}
Content-Type: application/json
{
"name":"upd19g",
"firstOrganize":"2pdzk6",
"secondOrganize":"4glkoo",
"paramKey":"isynj7",
"paramValue":"t09yd7",
"validStatus":1,
"modStatus":4,
"displayType":0,
"remark":"z5lbzt",
"createUserName":"75on7u"
}
> {%
client.global.set("Param_id", JSON.parse(response.body).data.id);
%}
###test Cookie
POST {{baseUrl}}/test/testCookie
Content-Type: application/json
...
...
smart-gateway/src/main/java/com/mortals/xhx/base/framework/filter/AccessLogFilter.java
View file @
243d9f4e
...
...
@@ -92,19 +92,21 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
AccessLogPdu
accessLogPdu
=
new
AccessLogPdu
();
accessLogPdu
.
initAttrValue
();
accessLogPdu
.
setAppName
(
appName
);
accessLogPdu
.
setTraceID
(
headers
.
getOrDefault
(
TRACE_ID
,
""
));
accessLogPdu
.
setPspanId
(
Integer
.
parseInt
(
headers
.
getOrDefault
(
PSPAN_ID
,
"0"
)));
accessLogPdu
.
setSpanId
(
Integer
.
parseInt
(
headers
.
getOrDefault
(
SPAN_ID
,
"1"
)));
accessLogPdu
.
setTraceID
(
headers
.
getOrDefault
(
TRACE_ID
,
""
));
accessLogPdu
.
setPspanId
(
Integer
.
parseInt
(
headers
.
getOrDefault
(
PSPAN_ID
,
"0"
)));
accessLogPdu
.
setSpanId
(
Integer
.
parseInt
(
headers
.
getOrDefault
(
SPAN_ID
,
"1"
)));
accessLogPdu
.
setSchemaData
(
request
.
getURI
().
getScheme
());
accessLogPdu
.
setHostName
(
NetUtil
.
getLocal
HostName
());
accessLogPdu
.
setHostName
(
request
.
getHeaders
().
getHost
().
get
HostName
());
accessLogPdu
.
setUri
(
requestPath
);
accessLogPdu
.
setTargetServer
(
route
.
getId
());
accessLogPdu
.
setRequestIp
(
IpUtils
.
getRealIpAddress
(
exchange
.
getRequest
()));
accessLogPdu
.
setUa
(
headers
.
getOrDefault
(
"User-Agent"
,
""
));
accessLogPdu
.
setUa
(
headers
.
getOrDefault
(
"User-Agent"
,
""
));
accessLogPdu
.
setRequestTime
(
new
Date
());
accessLogPdu
.
setLogTime
(
new
Date
());
accessLogPdu
.
setMethod
(
request
.
getMethodValue
());
log
.
info
(
"origin uri:{} host:{} port:{}"
,
requestPath
,
request
.
getHeaders
().
getHost
().
getHostName
(),
request
.
getHeaders
().
getHost
().
getPort
());
MediaType
mediaType
=
request
.
getHeaders
().
getContentType
();
if
(
MediaType
.
APPLICATION_FORM_URLENCODED
.
isCompatibleWith
(
mediaType
)
||
MediaType
.
APPLICATION_JSON
.
isCompatibleWith
(
mediaType
))
{
return
writeBodyLog
(
exchange
,
chain
,
accessLogPdu
);
...
...
@@ -161,12 +163,8 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
BodyInserter
bodyInserter
=
BodyInserters
.
fromPublisher
(
modifiedBody
,
String
.
class
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
putAll
(
exchange
.
getRequest
().
getHeaders
());
// the new content type will be computed by bodyInserter
// and then set in the request decorator
headers
.
remove
(
HttpHeaders
.
CONTENT_LENGTH
);
CachedBodyOutputMessage
outputMessage
=
new
CachedBodyOutputMessage
(
exchange
,
headers
);
return
bodyInserter
.
insert
(
outputMessage
,
new
BodyInserterContext
())
.
then
(
Mono
.
defer
(()
->
{
// 重新封装请求
...
...
@@ -234,7 +232,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
private
ServerHttpResponseDecorator
recordResponseLog
(
ServerWebExchange
exchange
,
AccessLogPdu
accessLogPdu
)
{
ServerHttpResponse
response
=
exchange
.
getResponse
();
DataBufferFactory
bufferFactory
=
response
.
bufferFactory
();
return
new
ServerHttpResponseDecorator
(
response
)
{
@Override
public
Mono
<
Void
>
writeWith
(
Publisher
<?
extends
DataBuffer
>
body
)
{
...
...
@@ -264,7 +261,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
//accessLogPdu.setResponseData(StrUtil.maxLength(responseResult,3000));
return bufferFactory.wrap(content);
}));*/
}
else
{
}
else
{
accessLogPdu
.
setResponseData
(
JSON
.
toJSONString
(
Rest
.
fail
()));
}
}
...
...
smart-gateway/src/main/resources/bootstrap.yml
View file @
243d9f4e
...
...
@@ -135,10 +135,10 @@ security:
-
/auth/xcxLogin
-
/auth/register
-
/resource/sms/code
logging
:
level
:
reactor.netty
:
info
org.springframework.cloud.gateway
:
TRACE
#
logging:
#
level:
#
reactor.netty: info
#
org.springframework.cloud.gateway: TRACE
...
...
smart-gateway/src/main/resources/logback-spring.xml
View file @
243d9f4e
...
...
@@ -39,6 +39,7 @@
<file>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-error.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logFilePath}/${springApplicationName:-default}/${springApplicationName:-default}-error.log.%d{yyyyMMdd}
</fileNamePattern>
<cleanHistoryOnStart>
true
</cleanHistoryOnStart>
<!--日志文件保留天数-->
<MaxHistory>
7
</MaxHistory>
</rollingPolicy>
...
...
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