无关风月
2024-07-19 cb6fe0ef6dda073a42ac4440e1417e611eeef0b3
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -847,7 +847,22 @@
        userService.removeById(tUser);
        return R.ok("注销成功");
    }
    @PostMapping("/deleteUserStudy")
    @ApiOperation(value = "注销当前帐号", tags = {"学习端-个人中心"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header"),
    })
    public R<String> deleteUserStudy() {
        if (tokenService.getLoginUserStudy() == null) {
            return R.tokenError("登录失效");
        }
        Integer userid = tokenService.getLoginUserStudy().getUserid();
        TUser tUser = userService.getById(userid);
        tUser.setState(3);
        userService.updateById(tUser);
        userService.removeById(tUser);
        return R.ok("注销成功");
    }
    @PostMapping("/logout")
    @ApiOperation(value = "退出登录", tags = {"家长端-个人中心"})
    @ApiImplicitParams({