From dbba5ee924ee09286c1a5f311c41a7bce100f6d7 Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Wed, 10 Dec 2025 14:48:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(openai):=20=E7=AE=80=E5=8C=96OpenAI?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除ApiException中多余的空字符串参数 - 统一异常消息格式,仅保留必要信息 - 清理未使用的异常参数传递 --- plugin/piadmin/app/utils/openai/OpenAiClient.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/piadmin/app/utils/openai/OpenAiClient.php b/plugin/piadmin/app/utils/openai/OpenAiClient.php index 4c060e6..dd571a0 100644 --- a/plugin/piadmin/app/utils/openai/OpenAiClient.php +++ b/plugin/piadmin/app/utils/openai/OpenAiClient.php @@ -15,16 +15,16 @@ class OpenAiClient $defaultPlatform = config('openai.default'); $platform = config('openai.platforms.' . $defaultPlatform, []); if (empty($platform)) { - throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置", '', '', []); + throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置"); } if (empty($platform['base_url'])) { - throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置base_url", '', '', []); + throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置base_url"); } if (empty($platform['api_key'])) { - throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置api_key", '', '', []); + throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置api_key"); } if (empty($platform['model'])) { - throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置model", '', '', []); + throw new ApiException("默认的AI平台: {$defaultPlatform} 未配置model"); } return $platform; }