水印下载

This commit is contained in:
宋伟佳
2021-12-28 16:23:58 +08:00
parent 7b037ccebd
commit 2c96ffe5dc
2 changed files with 10 additions and 12 deletions
@@ -382,14 +382,13 @@ export default {
}
},
downloadFileByWater(attId, fileSuffix) {
let fileExtension = fileSuffix.substring(fileSuffix.lastIndexOf(".") + 1);
if (fileExtension !== "pdf" && fileExtension !== "PDF") {
this.$message.error("水印下载仅支持PDF,pdf格式文件");
if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
this.$message.error('水印下载仅支持PDF,pdf格式文件')
} else {
if (attId != null && attId !== "") {
window.location.href = "/api/att/attFile/downloadFileForSarWaterMark?fileId=" + attId;
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId + '&userId=' + this.$store.getters.userInfo.userId
} else {
this.$message.error("请选择要下载的文件");
this.$message.error('请选择要下载的文件')
}
}
},
@@ -452,14 +452,13 @@ export default {
}
},
downloadFileByWater(attId, fileSuffix) {
let fileExtension = fileSuffix.substring(fileSuffix.lastIndexOf(".") + 1);
if (fileExtension !== "pdf" && fileExtension !== "PDF") {
this.$message.error("水印下载仅支持PDF,pdf格式文件");
if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
this.$message.error('水印下载仅支持PDF,pdf格式文件')
} else {
if (attId != null && attId !== "") {
window.location.href = "/api/att/attFile/downloadFileForSarWaterMark?fileId=" + attId;
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId + '&userId=' + this.$store.getters.userInfo.userId
} else {
this.$message.error("请选择要下载的文件");
this.$message.error('请选择要下载的文件')
}
}
},