提交 2287d51d 编写于 作者: WOSHIMAHAIFENG's avatar WOSHIMAHAIFENG

Merge branch 'alpha-filenew' into 'alpha'

修改压缩示例

See merge request !35
......@@ -786,13 +786,14 @@
}
},
unzipFileTest: function (_ : any) {
uni.downloadFile({
url: 'https://b2c-store.oss-ap-southeast-1.aliyuncs.com/ceshi/FRT.zip',
success: (res) => {
console.log(res)
const fileManager = uni.getFileSystemManager()
try {
fileManager.mkdirSync(`${this.basePath}${this.targetZip}`, true)
} catch (e) {
console.error(e)
}
fileManager.unzip({
zipFilePath: res.tempFilePath,
zipFilePath: '/static/filemanager/to.zip',
targetPath: `${this.basePath}${this.targetZip}`,
success: (res : FileManagerSuccessResult) => {
if (this.logAble) {
......@@ -812,11 +813,6 @@
}
} as UnzipFileOptions)
},
fail: (e) => {
console.log(e)
}
})
},
getSavedFileListTest: function () {
const fileManager = uni.getFileSystemManager()
......@@ -1233,13 +1229,9 @@
}
},
readZipEntry() {
uni.downloadFile({
url: 'https://b2c-store.oss-ap-southeast-1.aliyuncs.com/ceshi/FRT.zip',
success: (res) => {
console.log(res)
const fileManager = uni.getFileSystemManager()
fileManager.readZipEntry({
filePath: res.tempFilePath,
filePath: '/static/filemanager/to.zip',
encoding: 'utf-8',
success: (res : EntriesResult) => {
if (this.logAble) {
......@@ -1256,11 +1248,6 @@
}
} as ReadZipEntryOptions)
},
fail: (e) => {
console.log(e)
}
})
},
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册