From 1780a0bb8b4624691d8a21beb4ce7f092feb6b9e Mon Sep 17 00:00:00 2001
From: Miao_Spring <539943419@qq.com>
Date: Sat, 20 Jul 2024 21:16:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E6=97=B6?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/chatui.vue | 9 ++++++++-
src/views/chat.vue | 7 ++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/components/chatui.vue b/src/components/chatui.vue
index 5cfee5c..88f6898 100644
--- a/src/components/chatui.vue
+++ b/src/components/chatui.vue
@@ -6,7 +6,7 @@
{{ `${msg.from.split('-')[0]} ${msg.timestampString}` }}
{{ msg.msg }}
-
+
@@ -59,8 +59,15 @@ import { decrypt, decryptString, downloadFromUint8Array } from '../func/download
import { CubeOutline as DownloadIcon, CopyOutline } from '@vicons/ionicons5'
import fileSize2String from '@/func/fileSize2String'
import useClipboard from "vue-clipboard3";
+import { useMessage } from "naive-ui";
+const message = useMessage()
const { toClipboard } = useClipboard();
+
+const _toClipboard = async (text) => {
+ await toClipboard(text)
+ message.info(`已复制 ${text.length < 10 ? text : text.substring(0,7) + '...'}`)
+}
const setting = useSettingStore();
const serverPort = setting.serverPort;
const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
diff --git a/src/views/chat.vue b/src/views/chat.vue
index 9df9626..eb065fc 100644
--- a/src/views/chat.vue
+++ b/src/views/chat.vue
@@ -3,7 +3,7 @@
-
+
@@ -98,6 +98,11 @@ const message = useMessage()
// const modal = useModal();
const { toClipboard } = useClipboard();
+const _toClipboard = async (text) => {
+ await toClipboard(text)
+ message.info(`已复制 ${text.length < 10 ? text : text.substring(0,7) + '...'}`)
+}
+
const setting = useSettingStore();
const serverPort = setting.serverPort;
const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;