fix: fix /file_info api

This commit is contained in:
jmal 2023-04-15 23:08:09 +08:00
parent a410f750d7
commit 34e9ef7856
2 changed files with 10 additions and 8 deletions

View File

@ -288,17 +288,19 @@ export default {
}) })
}, },
// 根据id获取文件信息 // 根据id获取文件信息
getFileInfoById: function(id) { getFileInfoById: function(params) {
return request({ return request({
url: `/file_info/${id}`, url: '/file_info',
method: 'get' method: 'get',
params
}) })
}, },
// 根据id获取文件信息 // 根据id获取文件信息
getPublicFileInfoById: function(fileId, shareId) { getPublicFileInfoById: function(params) {
return request({ return request({
url: `/public/file_info/${fileId}/${shareId}`, url: '/public/file_info',
method: 'get' method: 'get',
params
}) })
}, },
} }

View File

@ -76,12 +76,12 @@ export default {
return return
} }
if(this.$store.state.user.token && this.$store.state.user.userId === this.file.userId){ if(this.$store.state.user.token && this.$store.state.user.userId === this.file.userId){
api.getFileInfoById(this.file.id).then(res => { api.getFileInfoById({id: this.file.id}).then(res => {
this.file = res.data this.file = res.data
this.loadFile() this.loadFile()
}) })
} else { } else {
api.getPublicFileInfoById(this.file.id, this.shareId).then(res => { api.getPublicFileInfoById({fileId: this.file.id, shareId: this.shareId}).then(res => {
this.file = res.data this.file = res.data
this.loadFile() this.loadFile()
}) })