k94314517
2024-06-28 820af5a78a30fb03eec4adaa2f1ffbc517e623d2
server/service/src/main/java/com/doumee/biz/system/impl/SystemUserBizImpl.java
@@ -2,6 +2,7 @@
import cn.emay.sdk.core.dto.sms.response.SmsResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.biz.system.SystemUserBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
@@ -41,6 +42,8 @@
    @Autowired
    private SmsEmailMapper smsEmailMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    @Autowired
    private CompanyService companyService;
    @Value("${debug_model}")
@@ -120,7 +123,8 @@
        if(StringUtils.isBlank(systemUser.getMobile()) || StringUtils.isBlank(systemUser.getCaptcha())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(!debugModel){
        String  phoneAtuh = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_PHONE_AUTH).getCode();
        if(!debugModel && !StringUtils.equals(phoneAtuh,Constants.ONE+"")){
            SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,systemUser.getMobile(),systemUser.getCaptcha());
        }
        SystemUser queryUserDto = new SystemUser();
@@ -144,7 +148,8 @@
        // 生成密码盐
        String salt = RandomStringUtils.randomAlphabetic(6);
        // 生成密码
        systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt));
//        systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt));
        systemUser.setPassword(Utils.Secure.encryptPassword(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.DEFAULT_PASSWORD).getCode(), salt));
        systemUser.setSalt(salt);
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        systemUser.setType(loginUserInfo.getType());
@@ -206,7 +211,8 @@
                if(StringUtils.isBlank(systemUser.getMobile()) || StringUtils.isBlank(systemUser.getCaptcha())){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"短信验证码不能为空!");
                }
                if(!debugModel){
                String  phoneAtuh = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_PHONE_AUTH).getCode();
                if(!debugModel && !StringUtils.equals(phoneAtuh,Constants.ONE+"")){
                    SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,systemUser.getMobile(),systemUser.getCaptcha());
                }
            }