feat : basic

This commit is contained in:
2024-11-12 11:02:38 +08:00
parent 235acbea9c
commit a9f81888b7
26 changed files with 342 additions and 209 deletions

View File

@@ -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());
}
}
}