diff --git a/km-extends/km-account/src/main/java/com/xiaojukeji/know/streaming/km/account/login/ldap/LdapLoginServiceImpl.java b/km-extends/km-account/src/main/java/com/xiaojukeji/know/streaming/km/account/login/ldap/LdapLoginServiceImpl.java index 64dc78ad9..aa56d842c 100644 --- a/km-extends/km-account/src/main/java/com/xiaojukeji/know/streaming/km/account/login/ldap/LdapLoginServiceImpl.java +++ b/km-extends/km-account/src/main/java/com/xiaojukeji/know/streaming/km/account/login/ldap/LdapLoginServiceImpl.java @@ -16,8 +16,8 @@ import com.xiaojukeji.know.streaming.km.account.common.bizenum.LoginServiceNameEnum; import com.xiaojukeji.know.streaming.km.account.common.ldap.LdapPrincipal; import com.xiaojukeji.know.streaming.km.account.login.ldap.remote.LdapAuthentication; +import com.xiaojukeji.know.streaming.km.common.constant.Constant; import com.xiaojukeji.know.streaming.km.common.utils.CommonUtils; -import com.xiaojukeji.know.streaming.km.common.utils.ConvertUtil; import com.xiaojukeji.know.streaming.km.common.utils.ValidateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,6 +80,10 @@ public UserBriefVO verifyLogin(AccountLoginDTO loginDTO, // user赋值 user = userService.getUserByUserName(ldapAttrsInfo.getSAMAccountName()); + } else if (ValidateUtils.isNull(user)) { + // user为空,且不自动注册用户时,赋值默认id给临时用户 + user = new User(); + user.setId(Constant.INVALID_CODE); } // 记录登录状态