zjh
2023-10-20 66a2bbaed29c6134b84e0916c96916a983bc64e8
ltkj-framework/src/main/java/com/ltkj/framework/web/service/SysLoginService.java
@@ -19,9 +19,7 @@
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.service.IDictHospService;
import com.ltkj.hosp.service.ITjCustomerService;
import com.ltkj.system.service.ISysDeptService;
import com.ltkj.system.service.ISysMenuService;
import com.ltkj.system.service.SysParametersDisposeService;
import com.ltkj.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
@@ -39,7 +37,6 @@
import com.ltkj.framework.manager.AsyncManager;
import com.ltkj.framework.manager.factory.AsyncFactory;
import com.ltkj.framework.security.context.AuthenticationContextHolder;
import com.ltkj.system.service.ISysUserService;
import java.util.Date;
import java.util.HashMap;
@@ -75,6 +72,8 @@
    private ISysDeptService deptService;
    @Autowired
    private SysParametersDisposeService parametersDisposeService;
    @Autowired
    private ISysConfigService configService;
    // 是否允许账户多终端同时登录(true允许 false不允许)
    @Value("${token.soloLogin}")
@@ -96,6 +95,8 @@
     */
    public String login(String username, String password, Boolean type,String code,String uuid) {
        String aSwitch = configService.selectConfigByKey("captcha_switch");
        if(null !=aSwitch && aSwitch.equals("Y")){
        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
        String captcha = redisCache.getCacheObject(verifyKey);
        redisCache.deleteObject(verifyKey);
@@ -109,6 +110,7 @@
            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
            throw new CaptchaException();
        }
        }
        // 用户验证
        Authentication authentication = null;