|
@@ -23,6 +23,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
|
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.security.auth.login.AccountLockedException;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
import java.util.HashSet;
|
|
@@ -67,14 +68,14 @@ public class HnqzUserDetailsServiceImpl implements HnqzUserDetailsService {
|
|
|
|
|
|
|
|
|
|
|
|
- Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS);
|
|
|
- if (cache != null && cache.get(rawUsername) != null) {
|
|
|
- return (HnqzUser) cache.get(rawUsername).get();
|
|
|
- }
|
|
|
+ // Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS);
|
|
|
+ // if (cache != null && cache.get(rawUsername) != null) {
|
|
|
+ // return (HnqzUser) cache.get(rawUsername).get();
|
|
|
+ // }
|
|
|
|
|
|
R<UserInfo> result = remoteUserService.info1(rawUsername, isApp, SecurityConstants.FROM_IN);
|
|
|
UserDetails userDetails = getUserDetails(result);
|
|
|
- cache.put(username, userDetails);
|
|
|
+ // cache.put(username, userDetails);
|
|
|
return userDetails;
|
|
|
}
|
|
|
|
|
@@ -117,6 +118,10 @@ public class HnqzUserDetailsServiceImpl implements HnqzUserDetailsService {
|
|
|
boolean enabled = StrUtil.equals(user.getLockFlag(), CommonConstants.STATUS_NORMAL);
|
|
|
// 构造security用户
|
|
|
|
|
|
+ if (!CommonConstants.STATUS_NORMAL.equals(user.getLockFlag())){
|
|
|
+ throw new RuntimeException("当前账号已经锁定了");
|
|
|
+ }
|
|
|
+
|
|
|
return new HnqzUser(user.getUserId(),
|
|
|
user.getDeptId(),
|
|
|
user.getPhone(),
|
|
@@ -127,7 +132,7 @@ public class HnqzUserDetailsServiceImpl implements HnqzUserDetailsService {
|
|
|
enabled,
|
|
|
true,
|
|
|
true,
|
|
|
- !CommonConstants.STATUS_LOCK.equals(user.getLockFlag()),
|
|
|
+ CommonConstants.STATUS_NORMAL.equals(user.getLockFlag()),
|
|
|
authorities,
|
|
|
user.getPlatId(),
|
|
|
user.getDrugEntId(),
|