From a03c040ff0186aca9cb792bc5ca19f3d1f7ee640 Mon Sep 17 00:00:00 2001 From: Lan Date: Mon, 3 Mar 2025 23:04:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=A4=8D=E5=88=B6wge?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/clipboard.ts | 8 ++ src/views/SendFileView.vue | 153 +++++++++++++++++++++++-------------- 2 files changed, 103 insertions(+), 58 deletions(-) diff --git a/src/utils/clipboard.ts b/src/utils/clipboard.ts index 8e8fbf7..249f097 100644 --- a/src/utils/clipboard.ts +++ b/src/utils/clipboard.ts @@ -79,3 +79,11 @@ export const copyRetrieveCode = async (code: string): Promise => { errorMsg: '复制失败,请手动复制取件码' }) } + +export const copyWgetCommand = async (code: string): Promise => { + const command = `wget ${window.location.origin}/share/select?code=${code}` + return copyToClipboard(command, { + successMsg: 'wget命令已复制到剪贴板', + errorMsg: '复制失败,请手动复制wget命令' + }) +} \ No newline at end of file diff --git a/src/views/SendFileView.vue b/src/views/SendFileView.vue index bc5e846..7a4911a 100644 --- a/src/views/SendFileView.vue +++ b/src/views/SendFileView.vue @@ -214,72 +214,107 @@ -
+
-

- 文件详情 -

-
-
- -

- 文件名:{{ selectedRecord.filename }} -

-
-
- -

- 发送日期:{{ selectedRecord.date }} -

-
-
- -

- 文件大小:{{ selectedRecord.size }} -

-
-
- -

- 过期时间:{{ selectedRecord.expiration }} -

+ class="w-full max-w-2xl rounded-2xl shadow-2xl transform transition-all duration-300 ease-out overflow-hidden" + :class="[isDarkMode ? 'bg-gray-900' : 'bg-white']"> + +
+
+

+ 文件详情 +

+
- -
-
-

- 取件码 -

-
-

{{ selectedRecord.retrieveCode }}

+ +
+ +
+
+
+ +
+
+

+ {{ selectedRecord.filename }} +

+

+ {{ selectedRecord.size }} · {{ selectedRecord.date }} +

+
+
+
+
+ + + {{ selectedRecord.expiration }} + +
+
+ + + 安全加密 + +
-

- 点击复制取件码 -

-
-

- 二维码 -

-
- + + +
+ +
+
+
+

取件码

+ +
+

{{ selectedRecord.retrieveCode }}

+
+ +
+
+

+ + wget下载 +

+ +
+

+ 点击复制wget命令 +

+
+
+ + +
+
+ +
+

+ 扫描二维码快速取件 +

-

- 扫描二维码快速取件 -

- + +
+ +
@@ -300,14 +335,16 @@ import { ClockIcon, EyeIcon, ShieldCheckIcon, - ClipboardCopyIcon + ClipboardCopyIcon, + TerminalIcon, + QrCodeIcon } from 'lucide-vue-next' import { useRouter } from 'vue-router' import BorderProgressBar from '@/components/common/BorderProgressBar.vue' import QRCode from 'qrcode.vue' import { useFileDataStore } from '../stores/fileData' import api from '@/utils/api' -import { copyRetrieveLink, copyRetrieveCode } from '@/utils/clipboard' +import { copyRetrieveLink, copyRetrieveCode, copyWgetCommand } from '@/utils/clipboard' import { getStorageUnit } from '@/utils/convert' const config: any = JSON.parse(localStorage.getItem('config') || '{}')