9
This commit is contained in:
@@ -81,15 +81,17 @@ class Utils
|
||||
* @param string $token 认证令牌
|
||||
* @return array 响应数据
|
||||
*/
|
||||
public static function send(string $path, array $data, string $errMsg, string $token = ''): array|bool
|
||||
public static function send(string $path, array $data, string $errMsg='', string $token = ''): array|bool
|
||||
{
|
||||
|
||||
$token = $token ? $token : Utils::getAdminToken();
|
||||
if($path != Url::$getAdminToken){
|
||||
$token = $token ? $token : Utils::getAdminToken();
|
||||
}
|
||||
$url = Url::buildUrl($path);
|
||||
//cp($url);
|
||||
log_alert($url);
|
||||
//log_alert($data);
|
||||
$res = self::request($url, $data, $token);
|
||||
//cp($data);
|
||||
//cp($res);
|
||||
//log_alert($res);
|
||||
$res = json_decode($res, true);
|
||||
if($res['errCode'] !==0 ){
|
||||
throw new \Exception($res['errMsg'],$res['errCode']);
|
||||
|
||||
Reference in New Issue
Block a user