|
|
@@ -61,6 +61,11 @@ class Alarm
|
|
|
$response = curl_exec($ch);
|
|
|
curl_close($ch);
|
|
|
|
|
|
- return json_decode($response, true);
|
|
|
+ if (curl_errno($ch)) {
|
|
|
+ // 请求失败,返回错误信息
|
|
|
+ return ['code' => 500, 'message' => curl_error($ch)];
|
|
|
+ }
|
|
|
+
|
|
|
+ return ['code' => 200, 'message' => json_decode($response, true)];
|
|
|
}
|
|
|
}
|