diff --git a/src/views/FileShareView.vue b/src/views/FileShareView.vue index 5edf329..f073bbf 100644 --- a/src/views/FileShareView.vue +++ b/src/views/FileShareView.vue @@ -47,11 +47,15 @@ const titleStringMobile = computed(() => { return descIsEmpty.value ? '' : '附言:' }) +const downloadUrl = computed(() => { + return `/file/${shareCode}/${fileRecord.value.file_name}?pw=${passwordInput.value}` +}) + async function downloadHandler() { // 构建一个下载请求 let a = document.createElement('a') a.style.display = 'none' - a.href = `/file/${shareCode}/${fileRecord.value.file_name}?pw=${passwordInput.value}` + a.href = downloadUrl.value a.download = fileRecord.value.file_name console.log(a.href) a.click() @@ -90,14 +94,19 @@ async function downloadHandler() { /> + > + + 文件不存在 + 下载 +