Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
024c8fae
Commit
024c8fae
authored
Apr 27, 2023
by
wqc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api解析
parent
66e2ea52
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletions
+33
-1
api-server/src/main/java/com/zq/api/controller/AppController.java
+1
-1
api-server/src/main/java/com/zq/api/form/ApiForm.java
+32
-0
No files found.
api-server/src/main/java/com/zq/api/controller/AppController.java
View file @
024c8fae
...
...
@@ -44,7 +44,7 @@ public class AppController {
form
.
setType
(
1
);
//解析业务参数
if
(!
form
.
parseBiz
Content
())
{
if
(!
form
.
parseBiz
())
{
return
ApiUtils
.
getParamError
(
form
);
}
...
...
api-server/src/main/java/com/zq/api/form/ApiForm.java
View file @
024c8fae
...
...
@@ -50,6 +50,38 @@ public class ApiForm {
if
(
StrUtil
.
isNotBlank
(
bizContent
)
&&
flag
)
{
bizContent
=
ApiUtils
.
decode
(
bizContent
,
""
);
}
if
(!
flag
)
{
bizContent
=
ApiUtils
.
decode
(
bizContent
,
"BASE64"
);
}
}
else
{
if
(
StrUtil
.
isNotBlank
(
bizContent
))
{
bizContent
=
ApiUtils
.
decode
(
bizContent
,
"BASE64"
);
}
}
if
(
bizContent
==
null
)
{
bizContent
=
""
;
}
bizContentJson
=
JSON
.
parseObject
(
bizContent
);
if
(
bizContentJson
==
null
)
{
bizContentJson
=
new
JSONObject
();
}
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"bizContent解析失败:{}"
,
e
.
getMessage
());
return
false
;
}
}
public
boolean
parseBiz
()
{
try
{
if
(
type
==
1
)
{
// API参数是否加密
boolean
flag
=
ConfigCache
.
getValueToBoolean
(
"API.PARAM.ENCRYPT"
);
if
(
StrUtil
.
isNotBlank
(
bizContent
)
&&
flag
)
{
bizContent
=
ApiUtils
.
decode
(
bizContent
,
""
);
}
}
else
{
if
(
StrUtil
.
isNotBlank
(
bizContent
))
{
bizContent
=
ApiUtils
.
decode
(
bizContent
,
"BASE64"
);
...
...
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