From c128c58110dd21f316276459783eae0dc35cc668 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 25 Feb 2025 19:51:07 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/WebSocketDialogMsg.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index ac08f239e..edb58f054 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -901,7 +901,11 @@ class WebSocketDialogMsg extends AbstractModel foreach ($matchs[2] as $key => $str) { $parsed = parse_url($str); if (str_starts_with($parsed['path'], "/uploads/")) { - $str = "{{RemoteURL}}" . ltrim($parsed['path'], "/"); + $relativePath = ltrim($parsed['path'], "/"); + $relativePath = Base::thumbRestore($relativePath); + if (file_exists(public_path($relativePath))) { + $str = "{{RemoteURL}}{$relativePath}"; + } } if ($imageSaveLocal === 'close') { $imageSize = @getimagesize($str);