use of com.jeeagile.core.exception.AgileBaseException in project jeeagile by jeeagile.
the class AgileUserDetailsServiceImpl method getUserDataByLoginName.
@Override
public AgileUserData getUserDataByLoginName(String loginName) {
try {
AgileSysUser agileSysUser = this.getAgileSysUser(loginName);
if (agileSysUser == null) {
throw new AgileAuthException("用户《" + loginName + "》不存在,请核实!");
}
this.checkAgileSysUser(agileSysUser);
return getAgileUserData(agileSysUser);
} catch (AgileBaseException ex) {
throw ex;
} catch (Exception ex) {
throw new AgileAuthException("加载用户信息异常!");
}
}
use of com.jeeagile.core.exception.AgileBaseException in project jeeagile by jeeagile.
the class AgileUserDetailsServiceImpl method getUserRole.
@Override
public List<String> getUserRole(AgileBaseUser agileBaseUser) {
try {
if (agileBaseUser != null) {
if (agileBaseUser.isSuperAdmin()) {
List<String> userRoleList = new ArrayList<>();
userRoleList.add("admin");
return userRoleList;
} else {
return agileUserDetailsMapper.getUserRoleByUserId(agileBaseUser.getUserId());
}
} else {
throw new AgileAuthException(AgileResultCode.FAIL_USER_INFO);
}
} catch (AgileBaseException ex) {
throw ex;
} catch (Exception ex) {
throw new AgileAuthException("加载用户角色信息异常!");
}
}
use of com.jeeagile.core.exception.AgileBaseException in project jeeagile by jeeagile.
the class AgileUserDetailsServiceImpl method getUserDataByUserId.
@Override
public AgileBaseUser getUserDataByUserId(String userId) {
try {
AgileSysUser agileSysUser = agileSysUserService.getById(userId);
this.checkAgileSysUser(agileSysUser);
return getAgileUserData(agileSysUserService.getById(userId));
} catch (AgileBaseException ex) {
throw ex;
} catch (Exception ex) {
throw new AgileAuthException("加载用户信息异常!");
}
}
Aggregations