From 2b5caf5c5c7bfc90e7f4d02159df74b9646e011b Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 10 八月 2022 13:56:47 +0800 Subject: [PATCH] 优化导出对象的子列表判断条件 --- src/main/java/com/ruoyi/framework/security/service/SysLoginService.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java index 8f8766c..3261d3b 100644 --- a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java +++ b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java @@ -22,6 +22,7 @@ import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.framework.redis.RedisCache; import com.ruoyi.framework.security.LoginUser; +import com.ruoyi.framework.security.context.AuthenticationContextHolder; import com.ruoyi.project.system.domain.SysUser; import com.ruoyi.project.system.service.ISysConfigService; import com.ruoyi.project.system.service.ISysUserService; @@ -60,9 +61,9 @@ */ public String login(String username, String password, String code, String uuid) { - boolean captchaOnOff = configService.selectCaptchaOnOff(); + boolean captchaEnabled = configService.selectCaptchaEnabled(); // 楠岃瘉鐮佸紑鍏� - if (captchaOnOff) + if (captchaEnabled) { validateCaptcha(username, code, uuid); } @@ -70,9 +71,10 @@ Authentication authentication = null; try { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); + AuthenticationContextHolder.setContext(authenticationToken); // 璇ユ柟娉曚細鍘昏皟鐢║serDetailsServiceImpl.loadUserByUsername - authentication = authenticationManager - .authenticate(new UsernamePasswordAuthenticationToken(username, password)); + authentication = authenticationManager.authenticate(authenticationToken); } catch (Exception e) { -- Gitblit v1.9.3