Merge pull request #434 from jamebal/dev
refactor(file-config): 重构直接文件 URL 生成逻辑
This commit is contained in:
commit
24c6ae7ed9
@ -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}`
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user