Merge pull request #434 from jamebal/dev

refactor(file-config): 重构直接文件 URL 生成逻辑
This commit is contained in:
jmal 2025-06-29 12:16:53 +08:00 committed by GitHub
commit 24c6ae7ed9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,10 +144,8 @@ export default {
return null;
},
directFileUrl: function(mark, file) {
if (file.isFolder) {
return window.location.origin + `${this.baseUrl}/direct-file/${mark}/${encodeURI(file.name)}.zip`
} else {
return window.location.origin + `${this.baseUrl}/direct-file/${mark}/${encodeURI(file.name)}`
}
const encodedName = encodeURIComponent(file.name);
const suffix = file.isFolder ? '.zip' : '';
return `${window.location.origin}${this.baseUrl}/direct-file/${mark}/${encodedName}${suffix}`
}
}