fix(项目设置): 修改MOCK端口时检查端口有效性

This commit is contained in:
shiziyuan9527 2022-03-07 18:45:20 +08:00 committed by fit2-zhao
parent 0e89db6369
commit 20d1108676
1 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.ProjectApplicationMapper;
import io.metersphere.base.mapper.ProjectMapper;
import io.metersphere.commons.constants.ProjectApplicationType;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.commons.utils.SessionUtils;
@ -104,6 +105,11 @@ public class ProjectApplicationService {
LogUtil.error("update project config parse mock port error.");
port = 0;
}
if (port == 0) {
MSException.throwException("tcp port cannot be 0");
}
if (port > 0) {
projectService.checkMockTcpPort(port);
}