Merge pull request #354 from jamebal/dev

feat: 新增文件下载操作日志
This commit is contained in:
jmal 2025-01-07 11:50:08 +08:00 committed by GitHub
commit 677aab7649
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "jmal-cloud-view", "name": "jmal-cloud-view",
"version": "2.10.1", "version": "2.11.0",
"description": "jmalcloud", "description": "jmalcloud",
"author": "Jmal <zhushilun084@163.com>", "author": "Jmal <zhushilun084@163.com>",
"license": "MIT", "license": "MIT",

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)