Browse Source

新增重置密码接口

tags/v2.4.1
xiaoying 1 year ago
parent
commit
ac6de17f54
3 changed files with 35 additions and 1 deletions
  1. +13
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/TenantController.java
  2. +2
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantService.java
  3. +20
    -1
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java

+ 13
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/TenantController.java View File



/** /**
* 更新租户状态(1 启用 0禁用) * 更新租户状态(1 启用 0禁用)
*
* @return * @return
*/ */
@PostMapping("/status") @PostMapping("/status")
return tenantService.updateStatus(dto, loginUser); return tenantService.updateStatus(dto, loginUser);
} }


/**
* 重置密码
* @param dto
* @param loginUser
* @return
*/
@PostMapping("/reset")
public JsonResult resetPassward(@RequestBody CreateClientTenantDto dto, @CurrentUser LoginUser loginUser) {
return tenantService.resetPassward(dto, loginUser);
}


} }

+ 2
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/TenantService.java View File

* @return * @return
*/ */
JsonResult updateStatus(CreateClientTenantDto dto, LoginUser loginUser); JsonResult updateStatus(CreateClientTenantDto dto, LoginUser loginUser);

JsonResult resetPassward(CreateClientTenantDto dto, LoginUser loginUser);
} }

+ 20
- 1
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java View File

return JsonResult.success(dto); return JsonResult.success(dto);
} }


/**
* 重置密码
*
* @param dto
* @param loginUser
* @return
*/
@Override
public JsonResult resetPassward(CreateClientTenantDto dto, LoginUser loginUser) {
if (ObjectUtil.isNull(dto.getId())) {
return JsonResult.error("租户id不能为空");
}
TenantPo tenantPo = tenantMapper.selectById(dto.getId());
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId());
userPo.setPassword(passward);
clientUserMapper.updatePass(userPo);

return JsonResult.success();
}

/** /**
* 更新租户状态(1 启用 0禁用) * 更新租户状态(1 启用 0禁用)
* *
} }
return JsonResult.success(); return JsonResult.success();
} }

} }

Loading…
Cancel
Save