|
@@ -55,8 +55,15 @@ class WithdrawService
|
|
|
'cer_front_img' => $front_img,//身份证正面照
|
|
|
'cer_reverse_img' => $back_img,//身份证反面照
|
|
|
];
|
|
|
- $res = self::request($url, $data);
|
|
|
+ $token = self::$token;
|
|
|
+
|
|
|
+ $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) {
|
|
|
+ return $res;
|
|
|
+ } else {
|
|
|
+ throw new ApiException($res['msg'] ?? '处理失败');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -80,16 +87,6 @@ class WithdrawService
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static function request($url, $data)
|
|
|
- {
|
|
|
- $url = self::$url . $url;
|
|
|
- $data = ['token' => self::$token, 'data' => $data];
|
|
|
- var_dump($data);
|
|
|
- var_dump($url);
|
|
|
- return json_decode(self::do_request(self::$url . $url, $data, ['content-type:application/json'], true, true), true);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
protected static function do_request($url, $data, $header = null, $post = true, $json = false, $format = 0, $form = false)
|
|
|
{
|
|
|
$curl = curl_init();
|