修正 Telegram 控制器與帳戶服務相關邏輯
This commit is contained in:
@@ -69,13 +69,15 @@ public static function CurlPost(string $url, array $data = []): array
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); // POST的資料
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$err = curl_error($ch);
|
||||
$error = curl_error($ch);
|
||||
$errno = curl_errno($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if ($err) {
|
||||
return ['ok' => false, 'error' => $err];
|
||||
}
|
||||
|
||||
return json_decode($response, true);
|
||||
return [
|
||||
'ok' => $errno === 0,
|
||||
'error' => $error,
|
||||
'code' => $errno,
|
||||
'body' => $response,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user