perf: 优化挂载文件链接

This commit is contained in:
jmal 2025-04-27 15:07:50 +08:00
parent ebbe6c64a9
commit 4de190a106
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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}`
}