水印下载

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) { downloadFileByWater(attId, fileSuffix) {
let fileExtension = fileSuffix.substring(fileSuffix.lastIndexOf(".") + 1); if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
if (fileExtension !== "pdf" && fileExtension !== "PDF") { this.$message.error('水印下载仅支持PDF,pdf格式文件')
this.$message.error("水印下载仅支持PDF,pdf格式文件");
} else { } else {
if (attId != null && attId !== "") { if (attId != null && attId !== '') {
window.location.href = "/api/att/attFile/downloadFileForSarWaterMark?fileId=" + attId; window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId + '&userId=' + this.$store.getters.userInfo.userId
} else { } else {
this.$message.error("请选择要下载的文件"); this.$message.error('请选择要下载的文件')
} }
} }
}, },
@@ -452,14 +452,13 @@ export default {
} }
}, },
downloadFileByWater(attId, fileSuffix) { downloadFileByWater(attId, fileSuffix) {
let fileExtension = fileSuffix.substring(fileSuffix.lastIndexOf(".") + 1); if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
if (fileExtension !== "pdf" && fileExtension !== "PDF") { this.$message.error('水印下载仅支持PDF,pdf格式文件')
this.$message.error("水印下载仅支持PDF,pdf格式文件");
} else { } else {
if (attId != null && attId !== "") { if (attId != null && attId !== '') {
window.location.href = "/api/att/attFile/downloadFileForSarWaterMark?fileId=" + attId; window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId + '&userId=' + this.$store.getters.userInfo.userId
} else { } else {
this.$message.error("请选择要下载的文件"); this.$message.error('请选择要下载的文件')
} }
} }
}, },