diff --git a/src/components/preview/FileDetails.vue b/src/components/preview/FileDetails.vue index 6486603..7ee47fa 100644 --- a/src/components/preview/FileDetails.vue +++ b/src/components/preview/FileDetails.vue @@ -198,10 +198,11 @@ export default { this.filepath = this.getLocalPath(this.file.path) this.pathUrl = `/?path=${this.filepath}&highlight=${this.file.name}` this.getIsSync() - if (this.fileUsername) { + const isMountFile = this.fileUsername || this.file.userId !== this.$store.getters.userId ? this.file.userId : undefined + if (isMountFile) { fileApi.getMountFileInfo({ fileId: this.file.id, - fileUsername: this.fileUsername + fileUserId: this.file.userId, }).then((res) => { const path = this.getLocalPath(res.data.path) this.filepath = path diff --git a/src/utils/file-config.js b/src/utils/file-config.js index fa8c0f0..3916038 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -34,7 +34,7 @@ export default { fileUrl = fileUrl.replaceAll('#', '%23') fileUrl = fileUrl.replaceAll(/%5C/g, '/') - if (file.userId !== store.getters.userId && !shareToken) { + if (file.userId !== store.getters.userId && token && !shareToken) { return `${baseUrl}/pre-file/${file.id}/${encodeURI(file.name)}?jmal-token=${token}&name=${username}` }