forked from github/dataease
Merge pull request #1979 from dataease/pr@dev@fix_login_type_error
fix: 登录验证用户来源
This commit is contained in:
commit
4aeaf0659d
@ -91,6 +91,11 @@ public class AuthServer implements AuthApi {
|
|||||||
|
|
||||||
SysUserEntity user = authUserService.getUserByName(username);
|
SysUserEntity user = authUserService.getUserByName(username);
|
||||||
|
|
||||||
|
// 验证登录类型是否与用户类型相同
|
||||||
|
if (!sysUserService.validateLoginType(user.getFrom(), loginType)) {
|
||||||
|
DataEaseException.throwException(Translator.get("i18n_id_or_pwd_error"));
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtils.isEmpty(user)) {
|
if (ObjectUtils.isEmpty(user)) {
|
||||||
DataEaseException.throwException(Translator.get("i18n_id_or_pwd_error"));
|
DataEaseException.throwException(Translator.get("i18n_id_or_pwd_error"));
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,11 @@ public class SysUserService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean validateLoginType(Integer from, Integer loginType) {
|
||||||
|
|
||||||
|
return ObjectUtils.isNotEmpty(from) && ObjectUtils.isNotEmpty(loginType) && from == loginType;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> ldapUserNames() {
|
public List<String> ldapUserNames() {
|
||||||
|
|
||||||
List<String> usernames = extSysUserMapper.ldapUserNames(1);
|
List<String> usernames = extSysUserMapper.ldapUserNames(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user