diff --git a/src/api/file-api.js b/src/api/file-api.js index 90a2dda..813951a 100644 --- a/src/api/file-api.js +++ b/src/api/file-api.js @@ -288,17 +288,19 @@ export default { }) }, // 根据id获取文件信息 - getFileInfoById: function(id) { + getFileInfoById: function(params) { return request({ - url: `/file_info/${id}`, - method: 'get' + url: '/file_info', + method: 'get', + params }) }, // 根据id获取文件信息 - getPublicFileInfoById: function(fileId, shareId) { + getPublicFileInfoById: function(params) { return request({ - url: `/public/file_info/${fileId}/${shareId}`, - method: 'get' + url: '/public/file_info', + method: 'get', + params }) }, } diff --git a/src/components/office/OnlyOfficeEditor.vue b/src/components/office/OnlyOfficeEditor.vue index b71aafe..51c55e3 100644 --- a/src/components/office/OnlyOfficeEditor.vue +++ b/src/components/office/OnlyOfficeEditor.vue @@ -76,12 +76,12 @@ export default { return } 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.loadFile() }) } 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.loadFile() })