From 2c0b9c5afa60e6804ab04985869a3614c6e1dea5 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 5 Aug 2026 14:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/api/controller/QywxPromotionPublicController.php | 6 ++++-- server/app/common/exception/ControllerExtendException.php | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/app/api/controller/QywxPromotionPublicController.php b/server/app/api/controller/QywxPromotionPublicController.php index 72fe664b1..cdb3eed38 100644 --- a/server/app/api/controller/QywxPromotionPublicController.php +++ b/server/app/api/controller/QywxPromotionPublicController.php @@ -4,14 +4,16 @@ declare(strict_types=1); namespace app\api\controller; -use app\BaseController; use app\common\service\qywx\QywxPromotionOpenWorkService; use app\common\service\qywx\QywxPromotionRedirectService; use think\facade\Log; /** 企业微信推广公开端点:服务商回调、授权回跳、JS 与随机跳转。 */ -class QywxPromotionPublicController extends BaseController +class QywxPromotionPublicController extends BaseApiController { + /** 公开安装代码、随机跳转与企业微信服务商回调均不依赖前台用户登录。 */ + public array $notNeedLogin = ['script', 'redirect', 'providerCallback', 'authCallback']; + public function script(string $key) { if (!QywxPromotionRedirectService::poolExists($key)) { diff --git a/server/app/common/exception/ControllerExtendException.php b/server/app/common/exception/ControllerExtendException.php index c6b156a12..947009f8b 100755 --- a/server/app/common/exception/ControllerExtendException.php +++ b/server/app/common/exception/ControllerExtendException.php @@ -25,6 +25,9 @@ use think\Exception; */ class ControllerExtendException extends Exception { + /** PHP 8.2 不再允许通过赋值隐式创建动态属性。 */ + protected string $model = ''; + /** * 构造方法 * @access public @@ -37,4 +40,4 @@ class ControllerExtendException extends Exception $this->message = '控制器需要继承模块的基础控制器:' . $message; $this->model = $model; } -} \ No newline at end of file +}