diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 132d65f50..54617d4ef 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -582,9 +582,14 @@ class WebSocketDialogMsg extends AbstractModel // 其他网络图片 preg_match_all("/]*?src=([\"'])(.*?\.(png|jpg|jpeg|gif))\\1[^>]*?>/is", $text, $matchs); foreach ($matchs[2] as $key => $str) { - $tmpPath = "uploads/chat/" . date("Ym") . "/" . $dialog_id . "/"; - Base::makeDir(public_path($tmpPath)); - $tmpPath .= md5s($str) . "." . $matchs[3][$key]; + if (str_starts_with($str, "{{RemoteURL}}")) { + $tmpPath = Base::leftDelete($str, "{{RemoteURL}}"); + $tmpPath = Base::rightDelete($tmpPath, "_thumb.jpg"); + } else { + $tmpPath = "uploads/chat/" . date("Ym") . "/" . $dialog_id . "/"; + Base::makeDir(public_path($tmpPath)); + $tmpPath .= md5s($str) . "." . $matchs[3][$key]; + } if (file_exists(public_path($tmpPath))) { $imagesize = getimagesize(public_path($tmpPath)); if (Base::imgThumb(public_path($tmpPath), public_path($tmpPath) . "_thumb.jpg", 320, 0)) { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 31d6faa61..67b6056f8 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -896,6 +896,7 @@ export default { // if (this.replyActiveUpdate) { // 修改 + msgText = msgText.replace(new RegExp(`src=(["'])${$A.apiUrl('../')}`, "g"), "src=$1{{RemoteURL}}") const update_id = this.replyId this.$store.dispatch("setLoad", { key: `msg-${update_id}`,