yumeng 1 年之前
父节点
当前提交
8e19dd7aff

+ 3 - 0
ruixuan-admin/src/main/resources/application-dev.yml

@@ -202,3 +202,6 @@ pcm:
 
 express:
   callback: http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/callback
+
+accept:
+  privateKey: JRowMMndTkSlvVORNvtJbw==

+ 4 - 1
ruixuan-admin/src/main/resources/application-mgs.yml

@@ -198,4 +198,7 @@ pcm:
   local-path: /data/file/jiaoyang/
 
 express:
-  callback: http://mgs.api.tjyourong.com.cn/itemCollectSamples/callback
+  callback: http://mgs.api.tjyourong.com.cn/itemCollectSamples/callback
+
+accept:
+  privateKey: Lj8XC4h9m639SjDsptx9Dg==

+ 4 - 1
ruixuan-admin/src/main/resources/application-prod.yml

@@ -198,4 +198,7 @@ pcm:
   local-path: /data/file/jiaoyang/
 
 express:
-  callback: http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/callback
+  callback: http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/callback
+
+accept:
+  privateKey: JRowMMndTkSlvVORNvtJbw==

+ 13 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiParam;
 import lombok.SneakyThrows;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -47,6 +48,16 @@ public class SupplyChainController extends BaseController {
     @Autowired
     private IKuaishouPromoterService promoterService;
 
+    @Value("${accept.privateKey}")
+    private String privateKey;
+
+    @GetMapping("/privateKey")
+    @ApiOperation(value = "达人订单")
+    public String privateKey() {
+
+       return privateKey;
+    }
+
     /**
      * 达人订单
      *
@@ -1896,11 +1907,12 @@ public class SupplyChainController extends BaseController {
 
     static ExecutorService fxNowService = Executors.newFixedThreadPool(3);
 
+
     @PostMapping(value = "/accept")
     public Map<String, Object> acceptEvent(@RequestBody String eventsEncoded) {
         // System.err.println(eventsEncoded);
         try {
-            String events = PlatformEventSecurityUtil.decode(eventsEncoded, "JRowMMndTkSlvVORNvtJbw==");
+            String events = PlatformEventSecurityUtil.decode(eventsEncoded, privateKey);
             JSONObject eventJSon = JSONObject.parseObject(events);
             fxNowService.submit(new Runnable() {
                 @Override