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