diff --git a/spider-flow-web/src/main/java/org/spiderflow/controller/SpiderFlowController.java b/spider-flow-web/src/main/java/org/spiderflow/controller/SpiderFlowController.java index 2c60f69..a550d63 100644 --- a/spider-flow-web/src/main/java/org/spiderflow/controller/SpiderFlowController.java +++ b/spider-flow-web/src/main/java/org/spiderflow/controller/SpiderFlowController.java @@ -3,6 +3,7 @@ package org.spiderflow.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spiderflow.Grammerable; @@ -164,7 +165,7 @@ public class SpiderFlowController { @RequestMapping("/log/download") public ResponseEntity download(String id, String taskId) { - if (StringUtils.isBlank(taskId)) { + if (StringUtils.isBlank(taskId) || NumberUtils.toInt(taskId,0) == 0) { Integer maxId = spiderFlowService.getFlowMaxTaskId(id); taskId = maxId == null ? "" : maxId.toString(); } diff --git a/spider-flow-web/src/main/resources/static/log.html b/spider-flow-web/src/main/resources/static/log.html index d8a4fd8..fe89d31 100644 --- a/spider-flow-web/src/main/resources/static/log.html +++ b/spider-flow-web/src/main/resources/static/log.html @@ -243,7 +243,7 @@ viewer.setOptions('reversed',true); viewer.init(); }).on('click','.btn-download',function(){ - window.open('spider/log/download?id=' + logId + "&taskId=" + taskId); + window.open('spider/log/download?id=' + logId + "&taskId=" + (taskId || '')); }); });