diff --git a/tools/activate-tool/src/main/java/com/njcn/gather/tool/active/controller/ActivateController.java b/tools/activate-tool/src/main/java/com/njcn/gather/tool/active/controller/ActivateController.java index 630ff5a5..030154f5 100644 --- a/tools/activate-tool/src/main/java/com/njcn/gather/tool/active/controller/ActivateController.java +++ b/tools/activate-tool/src/main/java/com/njcn/gather/tool/active/controller/ActivateController.java @@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.LogUtil; import com.njcn.gather.tool.active.service.ActivateService; @@ -57,7 +58,12 @@ public class ActivateController extends BaseController { public HttpResult getLicense() { String methodDescribe = getMethodDescribe("checkLicense"); LogUtil.njcnDebug(log, "{},获取许可信息", methodDescribe); - ActivationCodePlaintext activationCodePlaintext = activateService.readLicenseFile(); + ActivationCodePlaintext activationCodePlaintext = null; + try { + activationCodePlaintext = activateService.readLicenseFile(); + } catch (BusinessException e) { + methodDescribe = "无效的许可信息"; + } String macAddress = NetUtil.getLocalMacAddress(); if (activationCodePlaintext == null) { activationCodePlaintext = new ActivationCodePlaintext();