| | |
| | | return R.freeze("登录失败,您的账号已被冻结!"); |
| | | } |
| | | } else { |
| | | tUser1 = new TUser(); |
| | | // 手机验证码校验 |
| | | if (!phoneCode.equals("123456")) { |
| | | Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone); |
| | |
| | | if (!rCode.equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("登录失败,手机验证码无效!"); |
| | | } else { |
| | | tUser1.setHeadImg("https://haitunyingyu.obs.cn-southwest-2.myhuaweicloud.com/admin/1c6ee218aa18434db2e86df903990de8.jpg"); |
| | | tUser1 = getUser(phone); |
| | | tUser1.setHeadImg("https://haitunyingyu.obs.cn-southwest-2.myhuaweicloud.com/admin/1c6ee218aa18434db2e86df903990de8.jpg"); |
| | | String upperCase = UUIDUtil.getRandomCode(6).toUpperCase(); |
| | | tUser1.setAccount("用户"+upperCase); |
| | | tUser1.setName("用户"+upperCase); |
| | |
| | | TUserShare record = new TUserShare(); |
| | | record.setIntegral(integral); |
| | | record.setUserId(userid); |
| | | // 积分明细 |
| | | |
| | | userShareService.save(record); |
| | | TIntegralRecord tIntegralRecord = new TIntegralRecord(); |
| | | tIntegralRecord.setIntegral(data.getIntegralShare()); |
| | |
| | | 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({ |