From 34e9ef7856bfff272242fc92e526742089e70291 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 15 Apr 2023 23:08:09 +0800 Subject: [PATCH] fix: fix /file_info api --- src/api/file-api.js | 14 ++++++++------ src/components/office/OnlyOfficeEditor.vue | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) 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() })