uni.downloadFile({
url: that.baseUrl + '/app-api/erp/income/certificate/apply' + '?' +
`type=${that.proveInfo.code}`,
header: {
'Authorization': 'Bearer test01'
},
success(res) {
console.log(res);
const tempFilePath = res.tempFilePath;
let fileManager = uni.getFileSystemManager();
fileManager.saveFile({
tempFilePath: tempFilePath,
filePath: `${uni.env.USER_DATA_PATH}/file/${that.proveInfo.desc}.pdf`,
success: (result) => {
console.log(result);
uni.showToast({
content: '文件保存成功,路径:' + result.savedFilePath,
});
},
fail: (err) => {
console.log(err)
}
})
},
fail(res) {
console.log(res);
uni.alert({
content: res.errorMessage || res.error,
});
},
});
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31