From 5b9af90590eb8fd6b192a44fae8a5fe5466e2b0d Mon Sep 17 00:00:00 2001 From: Jason <5340635+wen-jason@user.noreply.gitee.com> Date: Thu, 29 Sep 2022 14:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/utils/file.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/utils/file.ts b/app/src/utils/file.ts index d1cac28e..d9dc8ed6 100644 --- a/app/src/utils/file.ts +++ b/app/src/utils/file.ts @@ -1,8 +1,9 @@ export async function saveImageToPhotosAlbum(url: string) { - if (!url) return uni.$u.toast('图片不存在') + if (!url) return uni.$u.toast('图片错误') //#ifdef H5 - uni.$u.$toast('长按图片保存') + uni.$u.toast('长按图片保存') //#endif + //#ifndef H5 try { const res: any = await uni.downloadFile({ url, timeout: 10000 }) await uni.saveImageToPhotosAlbum({ @@ -15,4 +16,5 @@ export async function saveImageToPhotosAlbum(url: string) { } catch (error: any) { uni.$u.toast(error.errMsg || '保存失败') } + //#endif }