diff --git a/cloud-common/src/main/java/com/cm/common/base/AbstractService.java b/cloud-common/src/main/java/com/cm/common/base/AbstractService.java index bb4655b..54f98fc 100644 --- a/cloud-common/src/main/java/com/cm/common/base/AbstractService.java +++ b/cloud-common/src/main/java/com/cm/common/base/AbstractService.java @@ -43,7 +43,11 @@ public abstract class AbstractService { */ protected void setSaveInfo(Map params) { UserInfoBO userInfoBO = securityComponent.getCurrentUser(); - setSave(userInfoBO.getUserId(), params); + if (userInfoBO != null) { + setSave(userInfoBO.getUserId(), params); + } else { + setSave("1", params); + } } /** @@ -89,7 +93,11 @@ public abstract class AbstractService { */ protected void setUpdateInfo(Map params) { UserInfoBO userInfoBO = securityComponent.getCurrentUser(); - setUpdate(userInfoBO.getUserId(), params); + if (userInfoBO != null) { + setUpdate(userInfoBO.getUserId(), params); + } else { + setUpdateInfo("1", params); + } } /** diff --git a/cloud-security/src/test/java/com/cm/LicenseTest.java b/cloud-security/src/test/java/com/cm/LicenseTest.java index 3711dc2..0838eb5 100644 --- a/cloud-security/src/test/java/com/cm/LicenseTest.java +++ b/cloud-security/src/test/java/com/cm/LicenseTest.java @@ -40,7 +40,8 @@ public class LicenseTest { // String mac = AddressUtil.getMacAddress(); // System.out.println(mac); // 环保统一用户:FA-16-3E-17-20-7D - String license = License.getLicense("2020-05-08", "10000", "FA-16-3E-17-20-7D", "_System_License_"); + // 包头体育局:00-16-3E-00-F3-CE + String license = License.getLicense("2020-05-14", "100", "00-16-3E-00-F3-CE", "_System_License_"); System.out.println(license); }