|
|
@@ -96,18 +96,22 @@ export default {
|
|
|
if(res.code == 1){
|
|
|
uni.hideLoading()
|
|
|
let file = res.data.file
|
|
|
+ let shortFile = res.data.shortFile
|
|
|
uni.downloadFile({
|
|
|
url: file,
|
|
|
- //header: {'content-type': 'application/vnd.ms-excel'},
|
|
|
- success: (res) => {
|
|
|
+ header: {"Content-Type": 'application/vnd.ms-excel'},
|
|
|
+ filePath: `${wx.env.USER_DATA_PATH}/${shortFile}`,
|
|
|
+ success: (res) => {
|
|
|
if (res.statusCode === 200) {
|
|
|
- console.log('res.tempFilePath',res)
|
|
|
- uni.saveImageToPhotosAlbum({
|
|
|
- filePath: res.tempFilePath,
|
|
|
- success: function (data) {
|
|
|
- uni.showToast({title:'下载成功,文件请加后缀 .xls 再使用',icon:'none',mask:true,duration: 5000})
|
|
|
+ wx.saveFileToDisk({
|
|
|
+ filePath: res.filePath,
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ },
|
|
|
+ fail:function(res) {
|
|
|
+ console.log(res)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
fail:()=>{
|