预览压缩包时,如果点击的是文件目录(树节点),页面会报错。所以加上判断,只有叶子节点才去预览文件

pull/147/head
刘长鸣 2023-06-06 23:08:19 +08:00
parent 3f47bb32a0
commit 6e1148ffc9
1 changed files with 4 additions and 2 deletions

View File

@ -51,8 +51,10 @@
}; };
function chooseNode(event, treeId, treeNode) { function chooseNode(event, treeId, treeNode) {
var path = '${baseUrl}' + treeNode.id +"?fileKey="+'${fileName}'; if (!treeNode.isParent) {
location.href = "${baseUrl}onlinePreview?url=" + encodeURIComponent(Base64.encode(path)); var path = '${baseUrl}' + treeNode.id + "?fileKey=" + '${fileName}';
location.href = "${baseUrl}onlinePreview?url=" + encodeURIComponent(Base64.encode(path));
}
} }
$(document).ready(function () { $(document).ready(function () {