From fcf4ee6761492b789ccbf984cf228d1b987e2165 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Mon, 27 May 2024 22:41:23 +0800 Subject: [PATCH] uu --- common/untool.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/untool.js b/common/untool.js index 105c712..c261388 100644 --- a/common/untool.js +++ b/common/untool.js @@ -1,5 +1,8 @@ import qs from "@/common/libs/qs" +// #ifdef H5 import { saveAs } from "file-saver" +// #endif + const tabBarUrls = [ '/pages/tabBar/deal/deal', @@ -112,16 +115,17 @@ const saveNetFile = (url) => { return new Promise(async (resolve, reject)=> { showLoading('正在保存文件') try{ - let { tempFilePath } = await downloadFile(url) - console.log("save:orgin:tempFilePath", tempFilePath) + let dRes = await getImageInfo(url) + console.log("save:downloadFile:getImageInfo", dRes) + let { tempFilePath, path } = dRes // #ifdef H5 - saveAs(tempFilePath) + saveAs(path) // #endif - // let res = await saveFile({ tempFilePath }) + // let res = await saveFile({ path }) // #ifdef APP-PLUS - plus.io.convertLocalFileSystemURL(tempFilePath); - plus.runtime.openFile(tempFilePath); //选择软件打开文件 + plus.io.convertLocalFileSystemURL(path); + plus.runtime.openFile(path); //选择软件打开文件 // #endif hideLoading()