fix: 修复挂载文件无法预览的问题

This commit is contained in:
jmal 2024-03-18 17:53:11 +08:00
parent 51f5e7e51b
commit 4aedaf1139
2 changed files with 6 additions and 4 deletions

View File

@ -3808,7 +3808,7 @@ export default {
totalSize += this.rowContextData.size;
}
if (totalSize > 0) {
var fileIds = [];
let fileIds = [];
if (this.$refs.fileListTable.tableSelectData.length > 0) {
this.$refs.fileListTable.tableSelectData.forEach(value => {
fileIds.push(value.id);
@ -4131,10 +4131,10 @@ export default {
}, 100);
},
determineDownload(file) {
this.downLaod(file);
this.download(file);
this.notPreviewDialogVisible = false;
},
downLaod(file) {
download(file) {
fileConfig.download(
this.$store.state.user.name,
file,

View File

@ -22,11 +22,13 @@ export default {
// 预览文件的url
previewUrl: function(username, file, token, shareToken) {
let owner
if (username !== store.getters.name) {
console.log('username', username, 'store.getters.name', store.getters.name)
if (username !== store.getters.name || localStorage.getItem('mountFileOwner') !== undefined) {
owner = localStorage.getItem('mountFileOwner')
} else {
owner = username
}
console.log('owner', owner)
let fileUrl = `${this.baseUrl}/file/${owner}${encodeURI(file.path)}${encodeURI(file.name)}`
fileUrl = fileUrl.replace(/%5C/g, '/')
if (token) {