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;
|
return null;
|
||||||
},
|
},
|
||||||
directFileUrl: function(mark, file) {
|
directFileUrl: function(mark, file) {
|
||||||
if (file.isFolder) {
|
const encodedName = encodeURIComponent(file.name);
|
||||||
return window.location.origin + `${this.baseUrl}/direct-file/${mark}/${encodeURI(file.name)}.zip`
|
const suffix = file.isFolder ? '.zip' : '';
|
||||||
} else {
|
return `${window.location.origin}${this.baseUrl}/direct-file/${mark}/${encodedName}${suffix}`
|
||||||
return window.location.origin + `${this.baseUrl}/direct-file/${mark}/${encodeURI(file.name)}`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user