| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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 { |
| | |
| | | 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()); |