| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean changePassword(String userOid,String oldPassword, String password, |
| | | String confirmPassword) throws PLException { |
| | | String confirmPassword) throws Exception { |
| | | WebUtil.alertNotNull(userOid,"用户主键",oldPassword,"登录密码",password,"密码",confirmPassword,"确认密码"); |
| | | if(!password.equals(confirmPassword)){ |
| | | throw new VciBaseException("密码和确认密码不相等"); |
| | | } |
| | | //对旧密码和密码进行解密,便于比对密码用 |
| | | oldPassword = Func.decryptAes(oldPassword,"daliantan0v0vcip"); |
| | | password = Func.decryptAes(password,"daliantan0v0vcip"); |
| | | //对比旧密码 |
| | | boolean b = this.checkPasswordEqual(oldPassword, userOid); |
| | | if(!b){ |
| | | throw new PLException("500", new String[] { "您输入的密码与登录密码不一致,请重新输入!"}); |
| | | } |
| | | if(!password.equals(confirmPassword)){ |
| | | throw new VciBaseException("密码和确认密码不相等"); |
| | | } |
| | | SmUserVO smUserVO = getUserByUserOid(userOid); |
| | | if(Func.isEmpty(smUserVO)){ |
| | |
| | | if (!StringUtils.isBlank(error)) { |
| | | throw new VciBaseException("当前设置的密码,密码策略校验未通过!"); |
| | | } |
| | | |
| | | //TODO:考虑是否需要将修改方式改成直接调用平台的接口,因为现在的修改方式没能正确的更新缓存 |
| | | /*UserInfo userInfo = new UserInfo(); |
| | | userInfo.id = userOid.trim(); |
| | | userInfo.pwd = password; |
| | | userInfo.pwdUpdateTime = System.currentTimeMillis(); |
| | | boolean updateBoolean = platformClientUtil.getFrameworkService().updateUser(userInfo, new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(), null)); |
| | | return updateBoolean;*/ |
| | | |
| | | ThreeDES des = new ThreeDES();// 实例化一个对�? |
| | | des.getKey("daliantan0v0");// 生成密匙 |
| | | String encPassword = des.getEncString(password); |
| | | //修改密码的同时需要将密码修改时间也更新 |
| | | String sql = "update pluser set plpassword = '" + encPassword + "', plpwdupdatetime = TO_DATE('" |
| | | + Func.format(new Date(),"yyyy-MM-dd HH:mm:ss") +"','yyyy-MM-dd hh24:mi:ssxff') where pluid = '" + userOid.trim() + "'"; |
| | | + Func.format(new Date(),"yyyy-MM-dd HH:mm:ss") +"','yyyy-MM-dd hh24:mi:ss') where pluid = '" + userOid.trim() + "'"; |
| | | try { |
| | | return platformClientUtil.getBOFactoryService().executeUpdateSql(sql); |
| | | } catch (PLException vciError) { |