Quellcode durchsuchen

新增重置密码接口

tags/v2.4.1
xiaoying vor 1 Jahr
Ursprung
Commit
ac6de17f54
3 geänderte Dateien mit 35 neuen und 1 gelöschten Zeilen
  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 Datei anzeigen

@@ -78,6 +78,7 @@ public class TenantController {

/**
* 更新租户状态(1 启用 0禁用)
*
* @return
*/
@PostMapping("/status")
@@ -85,4 +86,16 @@ public class TenantController {
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 Datei anzeigen

@@ -50,4 +50,6 @@ public interface TenantService {
* @return
*/
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 Datei anzeigen

@@ -414,6 +414,26 @@ public class TenantServiceImpl implements TenantService {
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禁用)
*
@@ -713,5 +733,4 @@ public class TenantServiceImpl implements TenantService {
}
return JsonResult.success();
}

}

Laden…
Abbrechen
Speichern