This commit is contained in:
aihe 2024-05-27 18:36:37 +08:00
parent 33584ce731
commit af1a22e4ee
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import qs from "@/common/libs/qs"
import { saveAs } from "file-saver"
const tabBarUrls = [
'/pages/tabBar/deal/deal',
@ -113,7 +114,10 @@ const saveNetFile = (url) => {
try{
let { tempFilePath } = await downloadFile(url)
console.log("save:orgin:tempFilePath", tempFilePath)
let res = await saveFile({ tempFilePath })
// #ifdef H5
saveAs(tempFilePath)
// #endif
// let res = await saveFile({ tempFilePath })
// #ifdef APP-PLUS
plus.io.convertLocalFileSystemURL(tempFilePath);
@ -122,7 +126,7 @@ const saveNetFile = (url) => {
hideLoading()
showToast('保存成功')
resolve(res)
resolve(tempFilePath)
}catch(e){
hideLoading()
showToast('保存失败')

View File

@ -14,7 +14,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dayjs": "^1.11.10"
"dayjs": "^1.11.10",
"file-saver": "2.0.5"
},
"dcloudext": {
"category": [