“mitao”
2025-12-26 6e3325a6906a0dcf9c2abcce5ef11d7ec9eed72f
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
@@ -1,7 +1,6 @@
package com.ruoyi.framework.web.service;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
@@ -26,7 +25,6 @@
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.TAppUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -211,7 +209,7 @@
            user.setPhone(username);
            user.setStatus(1);
            user.setName(String.format("用户%s", PhoneUtil.subAfter(username)));
            user.setProfilePhoto("");
            user.setProfilePhoto("https://jiashikang.cn/images/2025-12-26/30ae8143-dc90-49b7-bc1f-ac49b74ae092.png");
            tAppUserService.save(user);
            // throw new ServiceException(MessageUtils.message("user.not.exists"));
        } else {
@@ -220,11 +218,8 @@
                throw new ServiceException(MessageUtils.message("user.blocked"));
            }
        }
        if ("test".equals(env) || "dev".equals(env)) {
            if (!code.equals("111111")) {
                log.info("登录用户:{} 短信验证码错误{}", username,code);
                throw new ServiceException("短信验证码错误");
            }
        if (("test".equals(env) || "dev".equals(env)) && code.equals("111111")) {
           //直接放行
        } else {
            // 校验验证码
            Object cacheObject = redisCache.getCacheObject(user.getPhone());