feat : basic
This commit is contained in:
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Service\ServiceTrait\Api;
|
||||
|
||||
use App\Exception\ApiException;
|
||||
use App\Exception\ErrException;
|
||||
use App\Lib\Log;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
@@ -68,12 +68,12 @@ trait WxMiniTrait
|
||||
|
||||
$res = json_decode($contents,true);
|
||||
|
||||
if (empty($res['errcode']) || $res['errcode'] != 0) throw new ApiException($res['errmsg'] ?? '系统繁忙');
|
||||
if (empty($res['errcode']) || $res['errcode'] != 0) throw new ErrException($res['errmsg'] ?? '系统繁忙');
|
||||
|
||||
return $res;
|
||||
}catch (GuzzleException $e) {
|
||||
$this->log->debug(__CLASS__.':debug:'.$e->getMessage());
|
||||
throw new ApiException($e->getMessage());
|
||||
throw new ErrException($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user