Xiajijian
2026-01-22 df35513a888cd03f2a3e2eacdf9f1d9dc1f0c135
ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java
@@ -30,13 +30,13 @@
import com.ard.framework.manager.AsyncManager;
import com.ard.framework.manager.factory.AsyncFactory;
import com.ard.framework.security.context.AuthenticationContextHolder;
import com.ard.system.system.service.ISysConfigService;
import com.ard.system.system.service.ISysUserService;
import com.ard.system.service.ISysConfigService;
import com.ard.system.service.ISysUserService;
/**
 * 登录校验方法
 * 
 * @author ruoyi
 * @author ard
 */
@Component
public class SysLoginService
@@ -89,14 +89,10 @@
            AuthenticationContextHolder.setContext(authenticationToken);
            // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
            authentication = authenticationManager.authenticate(authenticationToken);
            // 获取用户ID
            LoginUser loginUser = (LoginUser) userDetailsService.loadUserByUsername(username);
            Long userId = loginUser.getUser().getUserId();
            // 登录成功逻辑
            if (authentication.isAuthenticated()) {
                // 检查是否已登录
                successHandler.onAuthenticationSuccess(userId);
                successHandler.onAuthenticationSuccess(authentication);
            }
        }
        catch (Exception e)
@@ -122,7 +118,7 @@
        if (!soloLogin)
        {
            // 如果用户不允许多终端同时登录,清除缓存信息
            String userIdKey = Constants.LOGIN_USERID_KEY + loginUser.getUser().getUserId();
            String userIdKey = CacheConstants.LOGIN_USERID_KEY + loginUser.getUser().getUserId();
            String userKey = redisCache.getCacheObject(userIdKey);
            if (StringUtils.isNotEmpty(userKey))
            {