From fcc88ecb0cce43b9e9a063ab95522fd64743e7e0 Mon Sep 17 00:00:00 2001 From: pllx Date: Wed, 1 Jul 2026 09:53:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B1=81=E5=85=8D=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=EF=BC=88=E7=AB=99=E9=95=BF=EF=BC=89?= =?UTF-8?q?=E5=9C=A8=E6=89=A7=E8=A1=8C=E7=AE=A1=E7=90=86=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=97=B6=E5=BF=85=E9=A1=BB=E5=9C=A8=E6=88=BF=E9=97=B4=E5=86=85?= =?UTF-8?q?=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/AdminCommandController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AdminCommandController.php b/app/Http/Controllers/AdminCommandController.php index e171248..bea1c60 100644 --- a/app/Http/Controllers/AdminCommandController.php +++ b/app/Http/Controllers/AdminCommandController.php @@ -599,8 +599,8 @@ class AdminCommandController extends Controller return ['ok' => false, 'message' => '无权进入该房间,不能执行管理命令']; } - // 管理命令只能作用于操作者当前所在房间,防止手工 POST 跨房间操作。 - if (! $this->chatState->isUserInRoom($roomId, $operator->username)) { + // 超级管理员(站长 id = 1)豁免必须进房的限制,允许全局管理;普通管理员必须在房间内方可管理 + if ($operator->id !== 1 && ! $this->chatState->isUserInRoom($roomId, $operator->username)) { return ['ok' => false, 'message' => '请先进入该房间后再执行管理命令']; }