feat: 新增文件下载操作日志

This commit is contained in:
jmal 2025-01-07 11:49:01 +08:00
parent 658b85885f
commit a88dbb725a
3 changed files with 5 additions and 9 deletions

View File

@ -4070,11 +4070,7 @@ export default {
fileIds.push(this.rowContextData.id) fileIds.push(this.rowContextData.id)
} }
if (fileIds.length > 1 || this.rowContextData.isFolder) { if (fileIds.length > 1 || this.rowContextData.isFolder) {
fileConfig.packageDownload( fileConfig.packageDownload(fileIds)
fileIds,
this.$store.state.user.token,
this.$store.state.user.name
)
return return
} }
fileConfig.download( fileConfig.download(

View File

@ -66,14 +66,14 @@ export default {
}, },
// 下载文件 // 下载文件
download: function(username, file, token) { download: function(username, file, token) {
fileApi.isAllowDownload().then(() => { fileApi.isAllowDownload({fileIds: [file.id]}).then(() => {
let url = this.previewUrl(username, file, token) + '&o=download' let url = this.previewUrl(username, file, token) + '&o=download'
window.open(url, '_self') window.open(url, '_self')
}) })
}, },
// 打包下载文件 // 打包下载文件
packageDownload: function(fileIds, token, username) { packageDownload: function(fileIds) {
fileApi.isAllowDownload().then(() => { fileApi.isAllowDownload({fileIds: fileIds}).then(() => {
fileIds = fileIds.join(',') fileIds = fileIds.join(',')
window.open(`${this.baseUrl}/packageDownload?fileIds=${fileIds}`, '_self') window.open(`${this.baseUrl}/packageDownload?fileIds=${fileIds}`, '_self')
}) })

View File

@ -614,7 +614,7 @@ export default {
fileIds.push(this.rowContextData.id) fileIds.push(this.rowContextData.id)
} }
if (fileIds.length > 1 || this.rowContextData.isFolder) { if (fileIds.length > 1 || this.rowContextData.isFolder) {
fileConfig.packageDownload(fileIds, this.$store.state.user.token, this.$store.state.user.name) fileConfig.packageDownload(fileIds)
return return
} }
fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token) fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token)