|
@@ -10,6 +10,7 @@ namespace crmeb\services;
|
|
|
|
|
|
|
|
|
|
|
|
|
use crmeb\exceptions\ApiException;
|
|
use crmeb\exceptions\ApiException;
|
|
|
|
|
+use think\Exception;
|
|
|
|
|
|
|
|
class WithdrawService
|
|
class WithdrawService
|
|
|
{
|
|
{
|
|
@@ -85,20 +86,14 @@ class WithdrawService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- protected static function decode($data)
|
|
|
|
|
|
|
+ public function decode($businessBodyString)
|
|
|
{
|
|
{
|
|
|
- $sKey = self::_sha1prng(self::$aeskey);
|
|
|
|
|
- var_dump($sKey);
|
|
|
|
|
- $iv = '';
|
|
|
|
|
- $decrypted = openssl_decrypt(base64_decode($data), 'AES-128-ECB', $sKey, OPENSSL_RAW_DATA, $iv);
|
|
|
|
|
- var_dump($decrypted);
|
|
|
|
|
- $decrypted = base64_decode($decrypted);
|
|
|
|
|
- return $decrypted;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static function _sha1prng($key)
|
|
|
|
|
- {
|
|
|
|
|
- return substr(openssl_digest(openssl_digest($key, 'sha1', true), 'sha1', true), 0, 16);
|
|
|
|
|
|
|
+ //进行Aes解密
|
|
|
|
|
+ include_once '../phpseclib/Crypt/AES.php';
|
|
|
|
|
+ $aes = new \Crypt_AES(CRYPT_AES_MODE_ECB);
|
|
|
|
|
+ $aes->setKey(self::$aeskey);
|
|
|
|
|
+ $data = $aes->decrypt(base64_decode($businessBodyString));
|
|
|
|
|
+ return $data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|