|
@@ -3,6 +3,7 @@ package com.ym.mec.auth.core.provider.service;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.ym.mec.auth.api.enums.UserLockFlag;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.authentication.LockedException;
|
|
@@ -50,7 +51,7 @@ public class DefaultUserDetailsService implements UserDetailsService {
|
|
|
}
|
|
|
if (userInfo == null) {
|
|
|
throw new UsernameNotFoundException("账户不存在");
|
|
|
- } else if (StringUtils.equals(userInfo.getSysUser().getLockFlag(), "9")) {
|
|
|
+ } else if (userInfo.getSysUser().getLockFlag() == UserLockFlag.NORMAL) {
|
|
|
throw new LockedException("账户被锁定");
|
|
|
}
|
|
|
|
|
@@ -67,7 +68,7 @@ public class DefaultUserDetailsService implements UserDetailsService {
|
|
|
|
|
|
SysUser sysUser = userInfo.getSysUser();
|
|
|
|
|
|
- return new AuthUser(sysUser.getId(), sysUser.getOrganId(), username, BCRYPT + sysUser.getPassword(), StringUtils.equals(sysUser.getLockFlag(), "0"),
|
|
|
+ return new AuthUser(sysUser.getId(), sysUser.getOrganId(), username, BCRYPT + sysUser.getPassword(), sysUser.getLockFlag() == UserLockFlag.NOACTIVATED,
|
|
|
true, true, true, authorities);
|
|
|
}
|
|
|
|