Browse Source

针对修改密码操作进行判空

tags/v2.4.0
xiaoying 1 year ago
parent
commit
74284b8120
1 changed files with 11 additions and 8 deletions
  1. +11
    -8
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java

+ 11
- 8
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java View File

@@ -271,13 +271,13 @@ public class ClientUserServiceImpl implements ClientUserSevice {
for (AuthoritiesPo authoritiesPo : poList) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
//TODO 后期维护各个业务平台
if ( authoritiesPo.getAuthority().contains("hhz")){
if (authoritiesPo.getAuthority().contains("hhz")) {
businessSystemVo.setClientId(HhzUrlConstant.HHZ_CLIENT);
businessSystemVo.setName(HhzUrlConstant.HHZ_NAME);
businessSystemVoList.add(businessSystemVo);
}
}
businessSystemVoList=businessSystemVoList.stream().distinct().collect(Collectors.toList());
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList());
vo.setList(businessSystemVoList);
return vo;
});
@@ -339,16 +339,19 @@ public class ClientUserServiceImpl implements ClientUserSevice {
}
TTenant tTenant = tenantMapper.getByCode(dto.getCode());
dto.setId(tTenant.getId());
//更新密码
dto.setPassword("{bcrypt}" + new BCryptPasswordEncoder().encode(dto.getPassword()));

TenantPo tenantPo = new TenantPo();
tenantPo.setName(dto.getName())
.setId(dto.getId());
tenantMapper.updateById(tenantPo);
UserPo userPo = new UserPo();
userPo.setUsername(dto.getUsername())
.setPassword(dto.getPassword());
clientUserMapper.updatePass(userPo);
//更新密码
if (ObjectUtil.isNotEmpty(dto.getPassword())) {
UserPo userPo = new UserPo();
userPo.setUsername(dto.getUsername());
dto.setPassword("{bcrypt}" + new BCryptPasswordEncoder().encode(dto.getPassword()));
userPo.setPassword(dto.getPassword());
clientUserMapper.updatePass(userPo);
}
return JsonResult.success();
}


Loading…
Cancel
Save