From 8dcec4bbf11bb54e340e393515ea29be46817242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=9D=B0?= Date: Thu, 24 Apr 2025 10:43:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E4=BC=98=E5=8C=96=20wget?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -移除未使用的变量和注释 - 调整 base URL 生成方式 - 优化 wget 命令的生成逻辑 --- src/utils/clipboard.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/utils/clipboard.ts b/src/utils/clipboard.ts index 426cc06..7c03a94 100644 --- a/src/utils/clipboard.ts +++ b/src/utils/clipboard.ts @@ -80,20 +80,9 @@ export const copyRetrieveCode = async (code: string): Promise => { }) } -const baseUrl = window.location.origin + '/#/'; - -/*export const copyWgetCommand = (retrieveCode: string, fileName: any) => { - //wget https://share.lanol.cn/share/select?code=17634 - const command = `wget ${baseUrl}share/select?code=${retrieveCode} -O "${fileName}"`; - navigator.clipboard.writeText(command).then(() => { - alertStore.showAlert('wget命令已复制到剪贴板', 'success'); - }).catch(() => { - alertStore.showAlert('复制wget命令失败', 'error'); - }); -};*/ +const baseUrl = window.location.origin + '/'; export const copyWgetCommand = (retrieveCode: string, fileName: string) => { - // const command = `wget ${window.location.origin}/download/${retrieveCode} -O ${filename}`; const command = `wget ${baseUrl}share/select?code=${retrieveCode} -O "${fileName}"`; if (navigator.clipboard && navigator.clipboard.writeText) {