|
|
@@ -56,11 +56,9 @@ class WithdrawService
|
|
|
'cer_reverse_img' => $back_img,//身份证反面照
|
|
|
];
|
|
|
$token = self::$token;
|
|
|
-
|
|
|
- var_dump(json_encode(compact('data', 'token'), 0));
|
|
|
$res = json_decode(self::do_request(self::$url . $url, compact('data', 'token'), ['content-type:application/json'], true, true), true);
|
|
|
- var_dump($res);
|
|
|
if ($res['code'] == 200) {
|
|
|
+ $res['data'] = self::decode($res['data']);
|
|
|
return $res;
|
|
|
} else {
|
|
|
throw new ApiException($res['msg'] ?? '处理失败');
|
|
|
@@ -87,6 +85,21 @@ class WithdrawService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected static function decode($data)
|
|
|
+ {
|
|
|
+ $sKey = self::_sha1prng(self::$aeskey);
|
|
|
+ $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);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
protected static function do_request($url, $data, $header = null, $post = true, $json = false, $format = 0, $form = false)
|
|
|
{
|