jiangping
2025-02-18 c97f0a7fdc240867112d363c31127d6afd49aaa3
server/services/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -51,8 +51,8 @@
    private SystemDictDataBiz systemDictDataBiz;
    @Value("${captcha_check}")
    private Boolean captchaCheck;
    @Value("${debug_model}")
    private Boolean debugModel;
    @Override
    public String loginByPassword(LoginDTO dto,  HttpServletRequest request) {
@@ -80,14 +80,14 @@
        loginLog.setLoginTime(new Date());
        loginLog.setSystemVersion(systemVersion);
        loginLog.setIp(Utils.User_Client.getIP(request));
        loginLog.setLocation(Utils.Location.getLocationString(loginLog.getIp()));
//        loginLog.setLocation(Utils.Location.getLocationString(loginLog.getIp()));
        loginLog.setPlatform(Utils.User_Client.getPlatform(request));
        loginLog.setClientInfo(Utils.User_Client.getBrowser(request));
        loginLog.setOsInfo(Utils.User_Client.getOS(request));
        loginLog.setServerIp(Utils.Server.getIP());
        if(needCheckCode){
            // 校验验证码
            if(captchaCheck) {
            if(!debugModel) {
                try {
                    captchaService.check(dto.getUuid(), dto.getCode());
                } catch (Exception e) {
@@ -120,12 +120,11 @@
            loginLog.setReason(e.getMessage().length() > 200 ? (e.getMessage().substring(0, 190) + "...") : e.getMessage());
            loginLog.setSuccess(Constants.ONE);
            systemLoginLogService.create(loginLog);
            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
            if (e.getCause() instanceof BusinessException) {
                throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(), e.getCause().getMessage());
            }
            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(), "对不起,账号或密码错误!");
        }
    }
}