From de026326a9df6f4a2192e99cf0e53e7e7b6d445d Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Fri, 24 Oct 2025 17:29:33 +0800
Subject: [PATCH] 1.整理文件管理文件路径。 2.新增航线信息接口业务。 3.优化KMZ文件接口业务逻辑。 4.pom文件修改。 5.增加业务工具类。 6.增加部分业务注解。 7.增加修改无人机状态方法。

---
 ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java b/ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java
index fd63a77..d7fec9a 100644
--- a/ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java
+++ b/ard-framework/src/main/java/com/ard/framework/web/service/SysLoginService.java
@@ -1,12 +1,15 @@
 package com.ard.framework.web.service;
 
 import javax.annotation.Resource;
+
+import com.ard.framework.security.handle.CustomAuthenticationSuccessHandler;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.authentication.BadCredentialsException;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.Authentication;
+import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.stereotype.Component;
 import com.ard.common.constant.CacheConstants;
 import com.ard.common.constant.Constants;
@@ -57,6 +60,12 @@
     @Autowired
     private ISysConfigService configService;
 
+    @Resource
+    private CustomAuthenticationSuccessHandler successHandler;
+
+    @Autowired
+    private UserDetailsService userDetailsService;
+
     /**
      * 登录验证
      * 
@@ -80,6 +89,15 @@
             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);
+            }
         }
         catch (Exception e)
         {
@@ -158,6 +176,7 @@
             AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
             throw new UserNotExistsException();
         }
+
         // 密码如果不在指定范围内 错误
         if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
                 || password.length() > UserConstants.PASSWORD_MAX_LENGTH)

--
Gitblit v1.9.3