Commit 024c8fae by wqc

api解析

parent 66e2ea52
......@@ -44,7 +44,7 @@ public class AppController {
form.setType(1);
//解析业务参数
if (!form.parseBizContent()) {
if (!form.parseBiz()) {
return ApiUtils.getParamError(form);
}
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment