Skip to content

Commit

Permalink
Merge pull request #354 from jamebal/dev
Browse files Browse the repository at this point in the history
feat: 新增文件下载操作日志
  • Loading branch information
jamebal authored Jan 7, 2025
2 parents 319e538 + d8be8cb commit 677aab7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jmal-cloud-view",
"version": "2.10.1",
"version": "2.11.0",
"description": "jmalcloud",
"author": "Jmal <zhushilun084@163.com>",
"license": "MIT",
Expand Down
6 changes: 1 addition & 5 deletions src/components/ShowFile/ShowFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4070,11 +4070,7 @@ export default {
fileIds.push(this.rowContextData.id)
}
if (fileIds.length > 1 || this.rowContextData.isFolder) {
fileConfig.packageDownload(
fileIds,
this.$store.state.user.token,
this.$store.state.user.name
)
fileConfig.packageDownload(fileIds)
return
}
fileConfig.download(
Expand Down
6 changes: 3 additions & 3 deletions src/utils/file-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ export default {
},
// 下载文件
download: function(username, file, token) {
fileApi.isAllowDownload().then(() => {
fileApi.isAllowDownload({fileIds: [file.id]}).then(() => {
let url = this.previewUrl(username, file, token) + '&o=download'
window.open(url, '_self')
})
},
// 打包下载文件
packageDownload: function(fileIds, token, username) {
fileApi.isAllowDownload().then(() => {
packageDownload: function(fileIds) {
fileApi.isAllowDownload({fileIds: fileIds}).then(() => {
fileIds = fileIds.join(',')
window.open(`${this.baseUrl}/packageDownload?fileIds=${fileIds}`, '_self')
})
Expand Down
2 changes: 1 addition & 1 deletion src/views/home/mobile/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ export default {
fileIds.push(this.rowContextData.id)
}
if (fileIds.length > 1 || this.rowContextData.isFolder) {
fileConfig.packageDownload(fileIds, this.$store.state.user.token, this.$store.state.user.name)
fileConfig.packageDownload(fileIds)
return
}
fileConfig.download(this.$store.state.user.name, this.rowContextData, this.$store.state.user.token)
Expand Down

0 comments on commit 677aab7

Please sign in to comment.