From f040b20da3f47352a6ba57b662a4e8e4736afc8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 3 Mar 2026 22:06:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(wechat):=20=E4=BF=AE=E5=A4=8D=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E6=8E=88=E6=9D=83=E7=99=BB=E5=BD=95=E5=9C=A8=E7=A9=BA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0=E4=B8=8B=E7=9A=84=20parse?= =?UTF-8?q?=5Fstr=20=E7=B1=BB=E5=9E=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getWebOauthInfo 中先解析 query 再做字符串兜底 - 避免 source 无 query 时 parse_str 接收 null/false 导致 TypeError - 保持原有 code/rcode/state 参数解析逻辑不变 --- plugin/think-plugs-wechat/src/service/WechatService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/think-plugs-wechat/src/service/WechatService.php b/plugin/think-plugs-wechat/src/service/WechatService.php index 915095109..298143f71 100644 --- a/plugin/think-plugs-wechat/src/service/WechatService.php +++ b/plugin/think-plugs-wechat/src/service/WechatService.php @@ -267,7 +267,8 @@ class WechatService extends Service } if (static::getType() === 'api') { // 解析 GET 参数 - parse_str(parse_url($source, PHP_URL_QUERY), $params); + $query = parse_url($source, PHP_URL_QUERY); + parse_str(is_string($query) ? $query : '', $params); $getVars = [ 'code' => $params['code'] ?? input('code', ''), 'rcode' => $params['rcode'] ?? input('rcode', ''),