From 4de190a1064ea368aa18ab295a16d10b0d13274a Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 27 Apr 2025 15:07:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/FileDetails.vue | 5 +++-- src/utils/file-config.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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}` }