|
|
@@ -6,6 +6,7 @@ const singleFileMaxSize = 50 * 1024 * 1024; |
|
|
|
const maxSpaceSize = 200 * 1024 * 1024; |
|
|
|
const dir = wx.env.USER_DATA_PATH; |
|
|
|
const genFilePath = (ipfsCid, extension, fileName) => `${dir}/${ipfsCid}/${fileName}.${extension}`; |
|
|
|
const genFileFolder = ipfsCid => `${dir}/${ipfsCid}`; |
|
|
|
const fileManager = getFileSystemManager(); |
|
|
|
const isAndroid = wx.getSystemInfoSync().platform === 'android'; |
|
|
|
const iosSupportFilesType = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf']; |
|
|
@@ -65,6 +66,7 @@ export function previewFile(ipfsCid, fileName, extension, fileSize) { |
|
|
|
fail: () => { |
|
|
|
gcDirSpace(); |
|
|
|
showLoading({ mask: true }); |
|
|
|
fileManager.mkdirSync(genFileFolder(ipfsCid)); |
|
|
|
const task = downloadFile(ipfsCid, { |
|
|
|
filePath, |
|
|
|
success: (param) => { |
|
|
|