fix: 私密分享的office文件挂载后无法预览的问题 #82
This commit is contained in:
parent
47d6bf59ea
commit
ebf14b7b3e
@ -2653,6 +2653,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 设置挂载文件的用户名(文件的所有者)
|
// 设置挂载文件的用户名(文件的所有者)
|
||||||
setMountFileOwner() {
|
setMountFileOwner() {
|
||||||
|
localStorage.removeItem('mountFileOwner')
|
||||||
if (this.$route.query.folder && this.fileList.length > 0) {
|
if (this.$route.query.folder && this.fileList.length > 0) {
|
||||||
let firstFile = this.fileList[0]
|
let firstFile = this.fileList[0]
|
||||||
if (firstFile.userId !== this.$store.getters.userId) {
|
if (firstFile.userId !== this.$store.getters.userId) {
|
||||||
|
|||||||
@ -100,13 +100,13 @@ export default {
|
|||||||
this.$store.dispatch('updateMessage', { event: 'loadFileFailed'})
|
this.$store.dispatch('updateMessage', { event: 'loadFileFailed'})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.$store.state.user.token && this.$store.state.user.userId === this.file.userId){
|
if (!this.shareId) {
|
||||||
api.getFileInfoById({id: this.file.id}).then(res => {
|
api.getPublicFileInfoById({fileId: this.file.id, shareId: this.shareId}).then(res => {
|
||||||
this.file = res.data
|
this.file = res.data
|
||||||
this.loadFile()
|
this.loadFile()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
api.getPublicFileInfoById({fileId: this.file.id, shareId: this.shareId}).then(res => {
|
api.getFileInfoById({id: this.file.id}).then(res => {
|
||||||
this.file = res.data
|
this.file = res.data
|
||||||
this.loadFile()
|
this.loadFile()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export default {
|
|||||||
// 预览文件的url
|
// 预览文件的url
|
||||||
previewUrl: function(username, file, token, shareToken) {
|
previewUrl: function(username, file, token, shareToken) {
|
||||||
let owner = null
|
let owner = null
|
||||||
if (username !== store.getters.name || localStorage.getItem('mountFileOwner') !== undefined) {
|
if (username !== store.getters.name || localStorage.getItem('mountFileOwner') !== null) {
|
||||||
owner = localStorage.getItem('mountFileOwner')
|
owner = localStorage.getItem('mountFileOwner')
|
||||||
} else {
|
} else {
|
||||||
owner = username
|
owner = username
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user