linwu 2 éve
szülő
commit
f140bda83a
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      app/common/service/RensheService.php

+ 3 - 3
app/common/service/RensheService.php

@@ -59,7 +59,7 @@ class RensheService
     private function _enDataCbc()
     {
         $data = $this->_time . json_encode($this->_data);
-        return base64_encode(openssl_encrypt($data, "sm4", self::KEY, 0, self::IV));
+        return base64_encode(openssl_encrypt($data, "SM4", self::KEY, 0, self::IV));
     }
 
     /**
@@ -69,7 +69,7 @@ class RensheService
      */
     private function _deDataCbc($data)
     {
-        $res = openssl_decrypt(base64_decode($data), "sm4", self::KEY, 0, self::IV);
+        $res = openssl_decrypt(base64_decode($data), "SM4", self::KEY, 0, self::IV);
         if ($res[0] != "{") {
             $res = mb_substr($res, 14, strlen($res), 'UTF-8');
         }
@@ -85,7 +85,7 @@ class RensheService
     private function _send($url)
     {
         //请求头
-        $enTime = base64_encode(openssl_encrypt($this->_time, "sm4", self::KEY, 0, self::IV));
+        $enTime = base64_encode(openssl_encrypt($this->_time, "SM4", self::KEY, 0, self::IV));
         $header = [
             'Content-Type: application/json',
             'Author-source: 1',