hrjy 2 年 前
コミット
2ae0169fc2
1 ファイル変更30 行追加30 行削除
  1. 30 30
      crmeb/services/GmService.php

+ 30 - 30
crmeb/services/GmService.php

@@ -75,36 +75,36 @@ class GmService
 
         echo self::string2hex(base64_decode(self::PUBLIC_KEY));
 
-        //初始化转换密钥信息
-        php_HextoAsc(self::string2hex(base64_decode(self::PRIVATE_KEY)), $k1);
-        php_HextoAsc(self::string2hex(base64_decode(self::PUBLIC_KEY)), $k2);
-        php_HextoAsc(self::string2hex(base64_decode(self::CGB_PUBLIC_KEY)), $gf_k);
-
-        //拼接参数数组
-        $data = [
-            'appID' => self::$appID,
-            'seqNO' => $seqNO,
-            'random' => strtoupper(md5($seqNO)),
-            'sm2EncryptData' => self::SM2Encrypt($key, $gf_k), //sm2加密key
-            'sm2Sign' => self::SM2Sign($key, $k2, $k1), //sm2加密key
-        ];
-        dump($data);
-        //拼接签名参数,md5转大写
-        $data['sign'] = self::SM3Crypt($data['random'] . $data['seqNO'] . self::$appSecretKey . $key);
-
-        dump($data);
-        exit;
-        //发送post接口请求
-        $res = self::https_post(self::$tokenUrl, $data);
-        halt($res);
-        exit();
-
-        //解密返回token数据
-        $token = self::SM2Decrypt(base64_decode($res['sm2EncryptData']), $k1);
-
-        self::$token = $token;
-        //返回token
-        return $token;
+//        //初始化转换密钥信息
+//        php_HextoAsc(self::string2hex(base64_decode(self::PRIVATE_KEY)), $k1);
+//        php_HextoAsc(self::string2hex(base64_decode(self::PUBLIC_KEY)), $k2);
+//        php_HextoAsc(self::string2hex(base64_decode(self::CGB_PUBLIC_KEY)), $gf_k);
+//
+//        //拼接参数数组
+//        $data = [
+//            'appID' => self::$appID,
+//            'seqNO' => $seqNO,
+//            'random' => strtoupper(md5($seqNO)),
+//            'sm2EncryptData' => self::SM2Encrypt($key, $gf_k), //sm2加密key
+//            'sm2Sign' => self::SM2Sign($key, $k2, $k1), //sm2加密key
+//        ];
+//        dump($data);
+//        //拼接签名参数,md5转大写
+//        $data['sign'] = self::SM3Crypt($data['random'] . $data['seqNO'] . self::$appSecretKey . $key);
+//
+//        dump($data);
+//        exit;
+//        //发送post接口请求
+//        $res = self::https_post(self::$tokenUrl, $data);
+//        halt($res);
+//        exit();
+//
+//        //解密返回token数据
+//        $token = self::SM2Decrypt(base64_decode($res['sm2EncryptData']), $k1);
+//
+//        self::$token = $token;
+//        //返回token
+//        return $token;
     }
 
     //业务请求数据