修正 Telegram 控制器與帳戶服務相關邏輯

This commit is contained in:
2025-05-20 16:07:35 +07:00
parent 5e392ae581
commit 92ad9debe8
6 changed files with 60 additions and 40 deletions
+8 -6
View File
@@ -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,
];
}
}