perf: 优化挂载文件链接
This commit is contained in:
parent
ebbe6c64a9
commit
4de190a106
@ -198,10 +198,11 @@ export default {
|
|||||||
this.filepath = this.getLocalPath(this.file.path)
|
this.filepath = this.getLocalPath(this.file.path)
|
||||||
this.pathUrl = `/?path=${this.filepath}&highlight=${this.file.name}`
|
this.pathUrl = `/?path=${this.filepath}&highlight=${this.file.name}`
|
||||||
this.getIsSync()
|
this.getIsSync()
|
||||||
if (this.fileUsername) {
|
const isMountFile = this.fileUsername || this.file.userId !== this.$store.getters.userId ? this.file.userId : undefined
|
||||||
|
if (isMountFile) {
|
||||||
fileApi.getMountFileInfo({
|
fileApi.getMountFileInfo({
|
||||||
fileId: this.file.id,
|
fileId: this.file.id,
|
||||||
fileUsername: this.fileUsername
|
fileUserId: this.file.userId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
const path = this.getLocalPath(res.data.path)
|
const path = this.getLocalPath(res.data.path)
|
||||||
this.filepath = path
|
this.filepath = path
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export default {
|
|||||||
fileUrl = fileUrl.replaceAll('#', '%23')
|
fileUrl = fileUrl.replaceAll('#', '%23')
|
||||||
fileUrl = fileUrl.replaceAll(/%5C/g, '/')
|
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}`
|
return `${baseUrl}/pre-file/${file.id}/${encodeURI(file.name)}?jmal-token=${token}&name=${username}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user