Commit ad815608 by wang_jiaxing

统一访问接口json判断

parent 3668f4d6
...@@ -22,7 +22,7 @@ public class TbStAppDzblController { ...@@ -22,7 +22,7 @@ public class TbStAppDzblController {
@PostMapping("/saveNewDzbl") @PostMapping("/saveNewDzbl")
@LogOper(czxxLbdm = "02", yymcJyqk = "0710", czxxJyqk = "新增电子笔录") @LogOper(czxxLbdm = "02", yymcJyqk = "0710", czxxJyqk = "新增电子笔录")
public R saveNewDzbl(TbStAppDzbl dzbl) { public R saveNewDzbl(@RequestBody TbStAppDzbl dzbl) {
try { try {
String xxzjbh = tbStAppDzblService.saveNewDzbl(dzbl); String xxzjbh = tbStAppDzblService.saveNewDzbl(dzbl);
return R.ok().data("xxzjbh", xxzjbh); return R.ok().data("xxzjbh", xxzjbh);
......
...@@ -19,9 +19,7 @@ import java.io.InputStreamReader; ...@@ -19,9 +19,7 @@ import java.io.InputStreamReader;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Enumeration; import java.util.*;
import java.util.HashMap;
import java.util.Map;
/** /**
* TODO * TODO
...@@ -37,6 +35,8 @@ public class ForwardController { ...@@ -37,6 +35,8 @@ public class ForwardController {
@RequestMapping("/method") @RequestMapping("/method")
public R method(HttpServletRequest request, @RequestParam(required = false) String sjdata) { public R method(HttpServletRequest request, @RequestParam(required = false) String sjdata) {
Set<String> jsonUrlSet = new HashSet<>();
jsonUrlSet.add("/dzbl/saveNewDzbl");
String url = request.getHeader("url"); String url = request.getHeader("url");
if (StringUtils.isEmpty(url)) { if (StringUtils.isEmpty(url)) {
return R.error("url不能为空"); return R.error("url不能为空");
...@@ -86,7 +86,7 @@ public class ForwardController { ...@@ -86,7 +86,7 @@ public class ForwardController {
headers.put("userIp", ip); headers.put("userIp", ip);
if ("post".equalsIgnoreCase(type)) { if ("post".equalsIgnoreCase(type)) {
String contentType = request.getContentType(); String contentType = request.getContentType();
if ("application/json".equals(contentType)) { if ("application/json".equals(contentType) || jsonUrlSet.contains(url)) {
try { try {
// BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), StandardCharsets.UTF_8)); // BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), StandardCharsets.UTF_8));
// StringBuilder sb = new StringBuilder(); // StringBuilder sb = new StringBuilder();
......
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