From e66d3db1a8ffa2fbd599e1f5a07b3f2a9e420354 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 28 Jul 2023 10:05:51 +0800 Subject: [PATCH] * Remove and tidy paramter. --- module/common/model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 9dd67bd9b7..e595e576fd 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3689,7 +3689,8 @@ EOF; { $url .= (strpos($url, '?') !== false ? '&' : '?') . http_build_query($data, '', '&', PHP_QUERY_RFC3986); - $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'GET'), $headers, 'json', 20)); + $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'GET'), $headers, 'json')); + if($result && $result->code == 200) return $result; return static::apiError($result); @@ -3706,7 +3707,7 @@ EOF; */ public static function apiPost($url, $data, $headers = array()) { - $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'POST'), $headers, 'json', 20)); + $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'POST'), $headers, 'json')); if($result && $result->code == 200) return $result; return static::apiError($result); @@ -3723,7 +3724,7 @@ EOF; */ public static function apiPut($url, $data, $headers = array()) { - $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'PUT'), $headers, 'json', 20)); + $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'PUT'), $headers, 'json')); if($result && $result->code == 200) return $result; return static::apiError($result); @@ -3740,7 +3741,7 @@ EOF; */ public static function apiDelete($url, $data, $headers = array()) { - $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'DELETE'), $headers, 'json', 20)); + $result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'DELETE'), $headers, 'json')); if($result && $result->code == 200) return $result; return static::apiError($result);