|
@@ -131,12 +131,22 @@ public class FamilyUserController {
|
|
|
return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Operation(summary = "带密码校验切换回家长视角(已废弃,使用 /api/family/member/switch)")
|
|
|
|
|
- @Deprecated
|
|
|
|
|
|
|
+ @Operation(summary = "带密码校验退出成员切换(返回原用户身份)")
|
|
|
@PostMapping("/switch-back-verify")
|
|
@PostMapping("/switch-back-verify")
|
|
|
public Result<Boolean> switchBackVerify(@RequestAttribute("userId") Long userId,
|
|
public Result<Boolean> switchBackVerify(@RequestAttribute("userId") Long userId,
|
|
|
@RequestBody Map<String, String> body) {
|
|
@RequestBody Map<String, String> body) {
|
|
|
- return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
|
|
|
|
|
|
|
+ if (userId == null) {
|
|
|
|
|
+ return Result.error("请先登录");
|
|
|
|
|
+ }
|
|
|
|
|
+ String password = body != null ? body.get("password") : null;
|
|
|
|
|
+ if (password == null || password.isEmpty()) {
|
|
|
|
|
+ return Result.error("请输入密码");
|
|
|
|
|
+ }
|
|
|
|
|
+ boolean valid = userService.verifyPassword(userId, password);
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return Result.error("密码错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ return Result.success(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "创建孩子")
|
|
@Operation(summary = "创建孩子")
|