From 775fdd2be09472f71b0912400c6ef167065de8ee Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 26 Aug 2025 20:19:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=BE=A4=E7=BB=84=E5=90=8D=E7=A7=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/DialogController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php index e685f8674..230e28467 100755 --- a/app/Http/Controllers/Api/DialogController.php +++ b/app/Http/Controllers/Api/DialogController.php @@ -2571,8 +2571,9 @@ class DialogController extends AbstractController $avatar = $avatar ? Base::unFillUrl(is_array($avatar) ? $avatar[0]['path'] : $avatar) : ''; $data['avatar'] = Base::fillUrl($array['avatar'] = $avatar); } - if (Request::exists('chat_name') && $dialog->group_type === 'user') { - $chatName = trim(Request::input('chat_name')); + $existName = Request::exists('chat_name') || Request::exists('name'); + if ($existName && $dialog->group_type === 'user') { + $chatName = trim(Request::input('chat_name') ?: Request::input('name')); if (mb_strlen($chatName) < 2) { return Base::retError('群名称至少2个字'); } @@ -2845,7 +2846,7 @@ class DialogController extends AbstractController ->orderByDesc('u.top_at') ->orderByDesc('u.last_at') ->paginate(Base::getPaginate(100, 20)); - + // 处理分页数据,与getDialogList保持一致的处理方式 $list->transform(function ($item) use ($user) { return WebSocketDialog::synthesizeData($item, $user->userid);