refactor(utils): 优化 wget命令生成逻辑

-移除未使用的变量和注释
- 调整 base URL 生成方式
- 优化 wget 命令的生成逻辑
This commit is contained in:
唐杰
2025-04-24 10:43:02 +08:00
parent 83e4f017e9
commit 8dcec4bbf1
+1 -12
View File
@@ -80,20 +80,9 @@ export const copyRetrieveCode = async (code: string): Promise<boolean> => {
})
}
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) {