From f0aae4b39afbcbb18fb5a0b32e3ca689662c5ca7 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 10 三月 2025 08:21:31 +0800
Subject: [PATCH] jar

---
 src/main/java/com/example/client/Login.java |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/example/client/Login.java b/src/main/java/com/example/client/Login.java
index 13cd379..45af729 100644
--- a/src/main/java/com/example/client/Login.java
+++ b/src/main/java/com/example/client/Login.java
@@ -5,6 +5,7 @@
 import com.example.server.user.model.SysUser;
 import com.example.server.user.service.UserService;
 import com.example.server.utils.CacheUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -139,6 +140,7 @@
         String finalSite = site;
         String finalTeamGroup = teamGroup;
         String finalTeam = team;
+        String finalTeamGroup1 = teamGroup;
         loginButton.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
@@ -149,10 +151,20 @@
 
                 user = userService.login(name, str);
                 exist = user.getExist();
-
+                Boolean exit2 = true;
+                if (StringUtils.isNotBlank(user.getTeamgroup())) {
+                    if (StringUtils.isNotBlank(finalTeamGroup1) && !finalTeamGroup1.equals("null")) {
+                        if (!finalTeamGroup1.contains(user.getTeamgroup())) {
+                            exit2 = false;
+                        }
+                    }
+                }
 
                 if (exist) {
-                    System.out.println("鐧诲綍鎴愬姛");
+                    if (!exit2) {
+                        JOptionPane.showMessageDialog(null, "褰撳墠鏈哄櫒涓嶆敮鎸佽涓撲笟鐢ㄦ埛鐧诲綍", "鎻愮ず", JOptionPane.WARNING_MESSAGE);
+                        return;
+                    }
                     try {
                         String path = Login.class.getClassLoader().getResource("config.properties").getPath();
                         OutputStream outputStream = null;
@@ -161,11 +173,12 @@
                             outputStream = new FileOutputStream(path);
                         } else {
                             try {
-                                outputStream = new FileOutputStream("config.properties");
+                                outputStream = new FileOutputStream(configPath);
                             } catch (FileNotFoundException ex) {
                                 ex.printStackTrace();
                             }
                         }
+
                         properties.setProperty("userName", name);
                         properties.setProperty("password", str);
                         properties.store(outputStream, "rxkj");

--
Gitblit v1.9.1