refactor: 关闭本地run.mode配置

This commit is contained in:
CaptainB 2021-10-28 17:49:54 +08:00 committed by 刘瑞斌
parent 3514b2d39d
commit 0573290ced
1 changed files with 0 additions and 11 deletions

View File

@ -37,9 +37,6 @@ public class LocalRealm extends BaseRealm {
@Resource @Resource
private UserService userService; private UserService userService;
@Value("${run.mode:release}")
private String runMode;
@Override @Override
public String getName() { public String getName() {
return "LOCAL"; return "LOCAL";
@ -71,14 +68,6 @@ public class LocalRealm extends BaseRealm {
String userId = token.getUsername(); String userId = token.getUsername();
String password = String.valueOf(token.getPassword()); String password = String.valueOf(token.getPassword());
if (StringUtils.equals("local", runMode)) {
UserDTO user = getUserWithOutAuthenticate(userId);
userId = user.getId();
SessionUser sessionUser = SessionUser.fromUser(user);
SessionUtils.putUser(sessionUser);
return new SimpleAuthenticationInfo(userId, password, getName());
}
if (StringUtils.equals(login, UserSource.LOCAL.name())) { if (StringUtils.equals(login, UserSource.LOCAL.name())) {
return loginLocalMode(userId, password); return loginLocalMode(userId, password);
} }