Browse Source

会员升级

Kirin 1 year ago
parent
commit
f5cb150c82
1 changed files with 8 additions and 11 deletions
  1. 8 11
      crmeb/services/WithdrawService.php

+ 8 - 11
crmeb/services/WithdrawService.php

@@ -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();