lvhao hace 1 día
padre
commit
b5cb33835e
Se han modificado 1 ficheros con 10 adiciones y 9 borrados
  1. 10 9
      core/CoreApp/controllers/Lyerpapi/v1/Yyys.php

+ 10 - 9
core/CoreApp/controllers/Lyerpapi/v1/Yyys.php

@@ -13,6 +13,15 @@ class Yyys extends Lyapi_Controller{
         $ip = $this->input->ip_address();
         $json_str = $this->input->raw_input_stream;
         $data = json_decode($json_str,true);
+        if(empty($data['gsmc']) || empty($data['timestamp'])){
+            $this->db->insert("ysnorecords",[
+                'ys_no'=>"",
+                'recept_cont'=>$json_str,
+                'addtime'=>time(),
+            ]);
+            echo "SUCCESS";
+            exit;
+        }
         $jiami_str =  hash_hmac('sha256', 'LYERP_'.$data['timestamp'], 'ys&ly202608261549');
         //$jiami_str.="&";
         // if($gsmc != $jiami_str){
@@ -37,15 +46,7 @@ class Yyys extends Lyapi_Controller{
             }
            
         }
-        if(empty($data['gsmc'])){
-            $this->db->insert("ysnorecords",[
-                'ys_no'=>"",
-                'recept_cont'=>$json_str,
-                'addtime'=>time(),
-            ]);
-            echo "SUCCESS";
-            exit;
-        }
+        
         if($jiami_str != $data['gsmc']){
             $this->db->insert("ysnorecords",[
                 'ys_no'=>$ys_no,