Browse Source

会员升级

Kirin 1 year ago
parent
commit
c617a03aff
1 changed files with 6 additions and 5 deletions
  1. 6 5
      crmeb/services/WithdrawService.php

+ 6 - 5
crmeb/services/WithdrawService.php

@@ -59,10 +59,11 @@ class WithdrawService
         $token = self::$token;
         $res = json_decode(self::do_request(self::$url . $url, compact('data', 'token'), ['content-type:application/json'], true, true), true);
         if ($res['code'] == 200) {
-            var_dump($res);
-            $res['data'] = self::decode($res['data']);
-            $res['data'] = base64_decode($res['data']);
-            return $res;
+            try {
+                return self::decode($res['data']);
+            } catch (\Exception $exception) {
+                throw new ApiException($exception->getMessage());
+            }
         } else {
             throw new ApiException($res['msg'] ?? '处理失败');
         }
@@ -95,7 +96,7 @@ class WithdrawService
         $aes = new \Crypt_AES(CRYPT_AES_MODE_ECB);
         $aes->setKey(self::$aeskey);
         $data = $aes->decrypt(base64_decode($businessBodyString));
-        return $data;
+        return base64_decode($data);
     }