diff --git a/front/components/Result/ImageCompressResult.vue b/front/components/Result/ImageCompressResult.vue index 9f01520..d290918 100644 --- a/front/components/Result/ImageCompressResult.vue +++ b/front/components/Result/ImageCompressResult.vue @@ -1,193 +1,166 @@ diff --git a/front/components/Share/FileShareView.vue b/front/components/Share/FileShareView.vue index 853d493..4e464c6 100644 --- a/front/components/Share/FileShareView.vue +++ b/front/components/Share/FileShareView.vue @@ -1,69 +1,81 @@ diff --git a/front/composables/useMyAppShare.ts b/front/composables/useMyAppShare.ts index 038f0c4..cecc599 100644 --- a/front/composables/useMyAppShare.ts +++ b/front/composables/useMyAppShare.ts @@ -36,16 +36,16 @@ const getShareToken = async ( return token } -const downloadFile = async (share_id: string) => { - try { - const token = await getShareToken(share_id) - if (!token) { - throw new Error('获取token失败') - } - window?.open(`/api/download?token=${token}`) - } catch (e) { - toast.error((e as any)?.data?.message || e) +const downloadFile = (token: string) => { + window?.open(`/api/download?token=${token}`) +} + +const downloadFileByShareId = async (share_id: string) => { + const token = await getShareToken(share_id) + if (!token) { + throw new Error('获取token失败') } + return downloadFile(token) } const createShare = async (data: any) => { @@ -98,6 +98,7 @@ const createTextShare = async (data: { text: string; config: any }) => { const useMyAppShare = () => { return { downloadFile, + downloadFileByShareId, createShare, createFileShare, createTextShare,