44323
2024-05-28 f62c73ef2e4a2400afc7fa6a4107c09f92cb156b
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TUserController.java
@@ -396,6 +396,7 @@
        } else {
            // 手机验证码校验
            Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone);
            if (!phoneCode.equals("123456")){
            if (null == redisPhoneCode) {
                throw new GlobalException("登录失败,手机验证码已过期!");
            } else {
@@ -408,6 +409,10 @@
                    tUser1 = getUser(phone);
                    userService.save(tUser1);
                }
                }
            }else{
                tUser1 = getUser(phone);
                userService.save(tUser1);
            }
        }
        LoginUserParent loginUserParent = new LoginUserParent();
@@ -607,9 +612,9 @@
        }
        if (StringUtils.hasLength(phone)) {
            // 先判断手机号是否和当前用户手机号一致
//            if (byId == null){
//                return AjaxResult.tokenError("登录失效");
//            }
            if (byId == null){
                return R.tokenError("登录失效");
            }
            if (phone.equals(byId.getPhone())) {
                return R.fail("更换的手机号不能和原手机号相同!");