فهرست منبع

20211025后端更新代码

mashengyi 3 سال پیش
والد
کامیت
61907100c4

+ 36 - 0
src/main/java/com/jkcredit/invoice/credit/SimpleCORSFilter.java

@@ -1,5 +1,6 @@
 package com.jkcredit.invoice.credit;
 
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jkcredit.invoice.common.ApiResult;
 import com.jkcredit.invoice.common.DataResult;
@@ -277,6 +278,9 @@ public class SimpleCORSFilter implements Filter {
         while(m.find()){
             api = m.group(1);
         }
+        if(StringUtils.isEmpty(api)){
+           api = getsrt("\"api\":\"", "\"", request).trim();;
+        }
         return  api;
     }
     private String getAppKey(String request){
@@ -286,6 +290,11 @@ public class SimpleCORSFilter implements Filter {
         while(m.find()){
             appkey = m.group(1);
         }
+
+        if(StringUtils.isEmpty(appkey)){
+            appkey = getsrt("\"appkey\":\"", "\"", request).trim();;
+
+        }
         return  appkey;
     }
     private String getAppSecret(String request){
@@ -295,6 +304,12 @@ public class SimpleCORSFilter implements Filter {
         while(m.find()){
             appSecret = m.group(1);
         }
+
+        if(StringUtils.isEmpty(appSecret)){
+            appSecret = getsrt("\"appSecret\":\"", "\"", request).trim();;
+
+        }
+
         return  appSecret;
     }
     private String getData(String request){
@@ -304,6 +319,11 @@ public class SimpleCORSFilter implements Filter {
         while(m.find()){
             data = m.group(1);
         }
+
+        if(StringUtils.isEmpty(data)){
+           // data = getsrt("\"data\":", ",", request).trim();;
+            data = JSONObject.parseObject(request.substring(0, request.length()-1)).getString("data");
+        }
         return  data;
     }
     /**
@@ -398,4 +418,20 @@ public class SimpleCORSFilter implements Filter {
 
         return null;
     }
+
+
+    public static String getsrt(String startkeystr, String endstr, String str) {
+        int customerindex = str.indexOf(startkeystr);
+        String temp = str.substring(customerindex + startkeystr.length());
+        int endindex = temp.indexOf(endstr);
+        String sss = temp.substring(0, endindex);
+        return sss;
+    }
+
+    public static String getsrt1(String startkeystr, String str) {
+        int customerindex = str.indexOf(startkeystr);
+        String temp = str.substring(customerindex + startkeystr.length());
+        return temp;
+    }
+
 }

+ 1 - 1
src/main/java/com/jkcredit/invoice/service/upService/impl/SelfCarInterfaceImpl.java

@@ -139,7 +139,7 @@ public class SelfCarInterfaceImpl  implements SelfCarInterface{
         } catch (IOException e) {
             log.error(e.getMessage());
             e.printStackTrace();
-            return new RespR(false,"网络异常,请联系管理人员");
+            return new RespR(false,"网络异常,请稍后再试");
         }catch (ApiRequestException apie) {
             log.error(apie.getMessage());
             apie.printStackTrace();