refactor(utils): 优化 wget命令生成逻辑
-移除未使用的变量和注释 - 调整 base URL 生成方式 - 优化 wget 命令的生成逻辑
This commit is contained in:
+1
-12
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user