From 80b5033b8d5b918c7ca2523bc2a69139c2bab438 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 15 六月 2024 19:21:33 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/DolphinEnglish

---
 ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
index b82fcae..52685cf 100644
--- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
+++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -104,6 +104,7 @@
 
     @Autowired
     private PayMoneyUtil payMoneyUtil;
+
     @PostMapping("/pay")
     @ApiOperation(value = "购买会员支付操作", tags = {"家长端-个人中心"})
     @ApiImplicitParams({
@@ -132,6 +133,7 @@
         }
         return AjaxResult.success();
     }
+
     @PostMapping("/order")
     @ApiOperation(value = "购买会员下单操作", tags = {"家长端-个人中心"})
     @ApiImplicitParams({
@@ -661,9 +663,10 @@
      */
     @GetMapping("/userInfo")
     @ApiOperation(value = "用户详情", tags = {"学习端-用户详情"})
-    public R<TUser> userInfo() {
-
-        return R.ok(userService.lambdaQuery().eq(TUser::getId, tokenService.getLoginUserStudy().getUserid()).one());
+    public R<UserPersonalCenterVO> userInfo() {
+        TUser user = userService.lambdaQuery().eq(TUser::getId, tokenService.getLoginUserStudy().getUserid()).one();
+        TUserStudy userStudy = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, user.getId()).eq(TUserStudy::getDisabled, 0).one();
+        return R.ok(new UserPersonalCenterVO(user, userStudy));
     }
 
     @PostMapping("/deleteUser")
@@ -733,16 +736,18 @@
             byId.setPhone(phone);
         }
         // 手机验证码校验
-        if (!phoneCode.equals("123456")) {
-            Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone);
-            if (null == redisPhoneCode) {
-                return R.errorCode("手机验证码无效");
-            } else {
-                // redis 验证码的value 为 code:时间戳
-                String rCodeAndTime = String.valueOf(redisPhoneCode);
-                String rCode = rCodeAndTime.split(":")[0];
-                if (!rCode.equalsIgnoreCase(phoneCode)) {
+        if (StringUtils.hasLength(phoneCode)){
+            if (!phoneCode.equals("123456")) {
+                Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone);
+                if (null == redisPhoneCode) {
                     return R.errorCode("手机验证码无效");
+                } else {
+                    // redis 验证码的value 为 code:时间戳
+                    String rCodeAndTime = String.valueOf(redisPhoneCode);
+                    String rCode = rCodeAndTime.split(":")[0];
+                    if (!rCode.equalsIgnoreCase(phoneCode)) {
+                        return R.errorCode("手机验证码无效");
+                    }
                 }
             }
         }

--
Gitblit v1.7.1