From 95ea0714ad2da59296a12cb34997df1bf58e9972 Mon Sep 17 00:00:00 2001 From: liu <2302563948@qq.com> Date: Tue, 1 Sep 2026 11:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/WangpuPayService.php | 17 ++++++++++++++--- app/Services/WechatMiniService.php | 4 +++- config/logging.php | 6 ++++++ .../SysSiteConfigItemsController.php | 4 ++-- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/Services/WangpuPayService.php b/app/Services/WangpuPayService.php index 6ec4231..c3e2cc7 100644 --- a/app/Services/WangpuPayService.php +++ b/app/Services/WangpuPayService.php @@ -130,14 +130,25 @@ class WangpuPayService $body = array_filter($body, static fn ($value): bool => $value !== null && $value !== ''); $body['sign'] = $this->sign($body); - $response = Http::asForm()->timeout(15)->post($baseUrl . $path, $body); + $response = Http::asForm()->withOptions([ + 'verify' => false, // 禁用 SSL 证书验证 + ])->timeout(15)->post($baseUrl . $path, $body); $result = $response->json(); if (! is_array($result)) { - Log::error('旺铺网关应答异常', ['path' => $path, 'status' => $response->status(), 'body' => $response->body()]); + Log::driver('pay')->error('旺铺网关应答异常', [ + 'path' => $path, + 'status' => $response->status(), + 'body' => $response->body(), + 'request' => $body, + ]); throw new RepositoryException('支付网关通讯异常,请稍后重试'); } if (($result['code'] ?? '') !== self::CODE_SUCCESS) { - Log::warning('旺铺网关应答失败', ['path' => $path, 'response' => $result]); + Log::driver('pay')->warning('旺铺网关应答失败', [ + 'path' => $path, + 'response' => $result, + 'request' => $body, + ]); throw new RepositoryException('支付网关下单失败:' . ($result['msg'] ?? '未知错误')); } diff --git a/app/Services/WechatMiniService.php b/app/Services/WechatMiniService.php index 569c3a1..b7b2291 100644 --- a/app/Services/WechatMiniService.php +++ b/app/Services/WechatMiniService.php @@ -28,7 +28,9 @@ class WechatMiniService throw new RepositoryException('微信小程序未配置 AppID/Secret,请联系管理员'); } - $result = Http::timeout(10)->get('https://api.weixin.qq.com/sns/jscode2session', [ + $result = Http::timeout(10)->withOptions([ + 'verify' => false, // 禁用 SSL 证书验证 + ])->get('https://api.weixin.qq.com/sns/jscode2session', [ 'appid' => $appid, 'secret' => $secret, 'js_code' => $code, diff --git a/config/logging.php b/config/logging.php index c5a4f81..3653a97 100644 --- a/config/logging.php +++ b/config/logging.php @@ -133,6 +133,12 @@ return [ 'level' => 'debug', ], + 'pay' => [ + 'driver' => 'single', + 'path' => storage_path('logs/pay.log'), + 'level' => 'debug', + ], + ], ]; diff --git a/modules/SystemTool/Http/Controllers/SysSiteConfigItemsController.php b/modules/SystemTool/Http/Controllers/SysSiteConfigItemsController.php index 952e443..2f05092 100644 --- a/modules/SystemTool/Http/Controllers/SysSiteConfigItemsController.php +++ b/modules/SystemTool/Http/Controllers/SysSiteConfigItemsController.php @@ -101,8 +101,8 @@ class SysSiteConfigItemsController extends BaseController SysSiteConfigService::refreshSiteConfig(); return $this->success(); } - $message = '设置保存失败:' . $result['message']; - return $this->error($message); + $message = '设置保存失败'; + return $this->error($result['errors'], $message); } /** 刷新设置 */