Commit a306f99b authored by 赵啸非's avatar 赵啸非

修改操作日志过滤

parent a01e5f67
......@@ -11518,11 +11518,12 @@ dict|object|字典对象
参数名称|类型|必填|描述
:---|:---|:---|:------
method|String|是|请求方法(post或者get)
body|String|是|请求参数体
**请求样例:**
```
{}
{"method":"post","body":{"test":"嘻嘻嘻"}}
```
**响应参数:**
......
......@@ -10,14 +10,8 @@ import lombok.Data;
@Data
public class MidReq{
private String appId;
private String method;
private String appKey;
private String timeStamp;
private String nonce;
private String secretKey;
private String body;
}
......@@ -70,25 +70,35 @@ public class MidSignApiController {
@PostMapping(value = "sign")
@UnAuth
public Rest<SignResp> midSign(@RequestBody String body) {
public Rest<SignResp> midSign(@RequestBody MidReq midReq) {
SignResp signResp = new SignResp();
try {
Map<String, String> headerMap = new HashMap<>();
headerMap.put("appId", appId);
headerMap.put("appKey", appKey);
headerMap.put("body", body);
String timeStamp = System.currentTimeMillis() + "";
headerMap.put("timeStamp", timeStamp);
String nonce = RandomUtil.randomNumbers(12);
headerMap.put("nonce", nonce);
headerMap.put("appSecret", secretKey);
if("post".equalsIgnoreCase(midReq.getMethod())){
headerMap.put("appId", appId);
headerMap.put("appKey", appKey);
headerMap.put("body", midReq.getBody());
String timeStamp = System.currentTimeMillis() + "";
headerMap.put("timeStamp", timeStamp);
String nonce = RandomUtil.randomNumbers(12);
headerMap.put("nonce", nonce);
headerMap.put("appSecret", secretKey);
signResp.setAppId(appId);
signResp.setAppKey(appKey);
signResp.setTimeStamp(timeStamp);
signResp.setNonce(nonce);
signResp.setSecretKey(secretKey);
signResp.setAppId(appId);
signResp.setAppKey(appKey);
signResp.setTimeStamp(timeStamp);
signResp.setNonce(nonce);
signResp.setSecretKey(secretKey);
}else if("get".equalsIgnoreCase(midReq.getMethod())){
HashMap<String, String> paramsMap = JSON.parseObject(midReq.getBody(), HashMap.class);
if (!paramsMap.isEmpty()) {
for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
headerMap.put(entry.getKey(), entry.getValue());
}
}
}
StringBuilder signSb = new StringBuilder();
for (Map.Entry<String, String> params : headerMap.entrySet()) {
......
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