use of com.jeeagile.system.entity.AgileSysUser in project jeeagile by jeeagile.
the class AgileUserDetailsServiceImpl method userLogin.
@Override
public AgileBaseUser userLogin(String loginName, String userPassword) {
try {
AgileSysUser agileSysUser = this.getAgileSysUser(loginName);
if (agileSysUser == null) {
throw new AgileAuthException("用户《" + loginName + "》不存在,请核实!");
}
this.checkAgileSysUser(agileSysUser);
String md5Password = AgileSecurityUtil.encryptPassword(userPassword);
if (!md5Password.equals(agileSysUser.getUserPwd())) {
throw new AgileAuthException(AgileResultCode.FAIL_USER_PWD, "用户密码错误!");
}
return getAgileUserData(agileSysUser);
} catch (AgileBaseException ex) {
throw ex;
} catch (Exception ex) {
throw new AgileAuthException("用户登录异常!");
}
}
use of com.jeeagile.system.entity.AgileSysUser in project jeeagile by jeeagile.
the class AgileSysPersonServiceImpl method updateUserAvatar.
@Override
public boolean updateUserAvatar(String userAvatar) {
AgileSysUser agileSysUser = new AgileSysUser();
agileSysUser.setId(AgileSecurityContext.getCurrentUserId());
agileSysUser.setUserAvatar(userAvatar);
return agileSysUserService.updateById(agileSysUser);
}
use of com.jeeagile.system.entity.AgileSysUser in project jeeagile by jeeagile.
the class AgileSysPersonServiceImpl method updatePersonInfo.
@Override
public boolean updatePersonInfo(AgileUpdatePerson agileUpdatePerson) {
AgileBaseUser userData = getCurrentUserData();
AgileSysUser agileSysUser = new AgileSysUser();
BeanUtils.copyProperties(agileUpdatePerson, agileSysUser);
agileSysUser.setId(userData.getUserId());
return agileSysUserService.updateById(agileSysUser);
}
use of com.jeeagile.system.entity.AgileSysUser in project jeeagile by jeeagile.
the class AgileSysPersonServiceImpl method updatePersonPwd.
@Override
public boolean updatePersonPwd(AgileUpdatePwd agileUpdatePwd) {
AgileBaseUser userData = getCurrentUserData();
AgileSysUser oldSysUser = agileSysUserService.getById(userData.getUserId());
String oldUserPwd = AgileSecurityUtil.encryptPassword(agileUpdatePwd.getOldPwd());
String newUserPwd = AgileSecurityUtil.encryptPassword(agileUpdatePwd.getNewPwd());
if (oldSysUser.getUserPwd().equals(oldUserPwd)) {
AgileSysUser newSysUser = new AgileSysUser();
newSysUser.setId(oldSysUser.getId());
newSysUser.setUserPwd(newUserPwd);
return agileSysUserService.updateById(newSysUser);
} else {
throw new AgileValidateException("输入的老密码有误,请确认!");
}
}
use of com.jeeagile.system.entity.AgileSysUser in project jeeagile by jeeagile.
the class AgileSysPersonServiceImpl method getPersonInfo.
@Override
public AgilePersonInfo getPersonInfo() {
AgilePersonInfo agilePersonInfo = new AgilePersonInfo();
AgileBaseUser userData = getCurrentUserData();
AgileSysUser agileSysUser = agileSysUserService.getById(userData.getUserId());
if (agileSysUser != null && AgileStringUtil.isNotEmpty(agileSysUser.getId())) {
BeanUtils.copyProperties(agileSysUser, agilePersonInfo);
agilePersonInfo.setDeptName(userData.getDeptName());
List<String> roleNameList = agileSysPersonMapper.getRoleNameByUserId(agileSysUser.getId());
List<String> postNameList = agileSysPersonMapper.getPostNameByUserId(agileSysUser.getId());
agilePersonInfo.setRoleNameList(roleNameList);
agilePersonInfo.setPostNameList(postNameList);
}
return agilePersonInfo;
}
Aggregations