Parcourir la source

伊宁版本更新:
a.新增sse服务器代码逻辑:全局以会话id为key存储各自会话的通讯链接,心跳包以及登出指令都以当前会话id为基础单位发送指令
b.修改伊宁mainView首页,增加跳转参数clientId用以sse通讯
c.新增sse请求地址获取接口

1037015548@qq.com il y a 1 mois
Parent
commit
75618d847b
29 fichiers modifiés avec 403 ajouts et 64 suppressions
  1. 170 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SseServlet.java
  2. 62 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java
  3. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  4. 8 7
      ruoyi-admin/src/main/resources/application-test.yml
  5. 95 15
      ruoyi-admin/src/main/resources/static/ruoyi/index.js
  6. 1 1
      ruoyi-admin/src/main/resources/templates/index-topnav.html
  7. 2 2
      ruoyi-admin/src/main/resources/templates/index.html
  8. 1 1
      ruoyi-admin/src/main/resources/templates/lock.html
  9. 1 1
      ruoyi-admin/src/main/resources/templates/login.html
  10. 1 1
      ruoyi-admin/src/main/resources/templates/loginBaokang.html
  11. 1 1
      ruoyi-admin/src/main/resources/templates/loginDangyang.html
  12. 1 1
      ruoyi-admin/src/main/resources/templates/loginJiangjin.html
  13. 1 1
      ruoyi-admin/src/main/resources/templates/loginYining.html
  14. 1 1
      ruoyi-admin/src/main/resources/templates/main.html
  15. 2 2
      ruoyi-admin/src/main/resources/templates/mainBaokang.html
  16. 1 1
      ruoyi-admin/src/main/resources/templates/mainBaokangView.html
  17. 2 2
      ruoyi-admin/src/main/resources/templates/mainDangyang.html
  18. 1 1
      ruoyi-admin/src/main/resources/templates/mainDangyangView.html
  19. 2 2
      ruoyi-admin/src/main/resources/templates/mainJiangjin.html
  20. 1 1
      ruoyi-admin/src/main/resources/templates/mainJiangjinView.html
  21. 2 2
      ruoyi-admin/src/main/resources/templates/mainLhk.html
  22. 2 2
      ruoyi-admin/src/main/resources/templates/mainYining.html
  23. 1 1
      ruoyi-admin/src/main/resources/templates/mainYiningMaskView.html
  24. 32 7
      ruoyi-admin/src/main/resources/templates/mainYiningView.html
  25. 1 1
      ruoyi-admin/src/main/resources/templates/main_v1.html
  26. 1 1
      ruoyi-admin/src/main/resources/templates/register.html
  27. 1 1
      ruoyi-admin/src/main/resources/templates/skin.html
  28. 3 3
      ruoyi-admin/src/main/resources/templates/view.html
  29. 4 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java

+ 170 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SseServlet.java

@@ -0,0 +1,170 @@
+package com.ruoyi.web.controller.system;
+
+/**
+ * @ClassName SseServlet
+ * @Description: TODO
+ * @Author LX
+ * @Date 2025/5/15
+ * @Version V1.0
+ **/
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.ShiroUtils;
+import com.ruoyi.framework.config.ShiroConfig;
+import com.ruoyi.framework.shiro.realm.UserRealm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.AsyncContext;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.time.LocalDateTime;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Controller
+public class SseServlet extends BaseController {
+//    private static final ConcurrentHashMap<String, PrintWriter> connections = new ConcurrentHashMap<>();
+
+    private static final Logger log = LoggerFactory.getLogger(SseServlet.class);
+
+    private static final  ConcurrentHashMap<String,ConcurrentHashMap<String, PrintWriter>> countConnections = new ConcurrentHashMap<>();
+
+    private static final ConcurrentHashMap<String,Timer> timerArray = new ConcurrentHashMap<>();
+
+    @GetMapping("/sse/subscribe")
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/event-stream");
+        response.setCharacterEncoding("UTF-8");
+        response.setHeader("Cache-Control", "no-cache");
+        response.setHeader("Connection", "keep-alive");
+
+        String clientId = request.getParameter("clientId");
+        if (clientId == null) {
+            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+            return;
+        }
+
+        // Start async processing
+        AsyncContext asyncContext = request.startAsync();
+
+        ConcurrentHashMap<String, PrintWriter> connections = new ConcurrentHashMap<>();
+        if (countConnections.get(ShiroUtils.getSessionId())!=null&&countConnections.get(ShiroUtils.getSessionId()).size()>0){
+            connections = countConnections.get(ShiroUtils.getSessionId());
+        }
+        PrintWriter writer = response.getWriter();
+        connections.put(clientId, writer);
+        countConnections.put(ShiroUtils.getSessionId(),connections);
+
+        // Set timeout for async context
+        asyncContext.setTimeout(0);
+        writer.println("data: Connected\n");
+        writer.flush();
+
+        //TODO 建立心跳定时包
+        final String sessionId = ShiroUtils.getSessionId();
+        Timer timer2 = new Timer();
+        TimerTask timerTask2 = new TimerTask() {
+            @Override
+            public void run() {
+                broadcastHeart(sessionId);
+            }
+        };
+        timer2.schedule(timerTask2, 2000, 2000);
+        timerArray.put(sessionId,timer2);
+
+        // Handle connection close
+        asyncContext.addListener(new javax.servlet.AsyncListener() {
+            @Override
+            public void onComplete(javax.servlet.AsyncEvent asyncEvent) throws IOException {
+                if(!CollectionUtils.isEmpty(countConnections)) {
+                    countConnections.get(ShiroUtils.getSessionId()).remove(clientId);
+                }
+            }
+
+            @Override
+            public void onTimeout(javax.servlet.AsyncEvent asyncEvent) throws IOException {
+                if(!CollectionUtils.isEmpty(countConnections)) {
+                    countConnections.get(ShiroUtils.getSessionId()).remove(clientId);
+                }
+            }
+
+            @Override
+            public void onError(javax.servlet.AsyncEvent asyncEvent) throws IOException {
+                if(!CollectionUtils.isEmpty(countConnections)) {
+                    countConnections.get(ShiroUtils.getSessionId()).remove(clientId);
+                }
+            }
+
+            @Override
+            public void onStartAsync(javax.servlet.AsyncEvent asyncEvent) throws IOException {
+                // No action needed here
+                System.out.println("开启链接");
+            }
+        });
+
+        log.info("建立链接成功:sessionId:"+sessionId+";clientId:"+clientId);
+    }
+
+    @GetMapping("/sse/logout")
+    @ResponseBody
+    protected AjaxResult logout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        broadcastLogout();
+        return AjaxResult.success();
+    }
+
+    @Value("${sseUrl}")
+    private String sseUrl;
+
+    @GetMapping("/sse/geturl")
+    @ResponseBody
+    protected AjaxResult geturl(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        try {
+            return AjaxResult.success().put("data",sseUrl);
+        }catch(Exception ex){
+            return AjaxResult.error(ex.getLocalizedMessage());
+        }
+    }
+
+
+    //TODO 广播
+    //TODO 心跳广播
+    public void broadcastHeart(String sessionId) {
+        if(!CollectionUtils.isEmpty(countConnections)) {
+            for (PrintWriter writer : countConnections.get(sessionId).values()) {
+                writer.println("event: heart");
+                writer.println("data: heart is running\n");
+                writer.flush();
+            }
+        }
+    }
+
+    public void broadcastLogout() {
+        if(!CollectionUtils.isEmpty(countConnections)) {
+            for (PrintWriter writer : countConnections.get(ShiroUtils.getSessionId()).values()) {
+                writer.println("event: logout");
+                writer.println("data: User is logging out\n");
+                writer.flush();
+            }
+        }
+        countConnections.remove(ShiroUtils.getSessionId());
+        if(!CollectionUtils.isEmpty(timerArray)){
+            Timer timerCurrent = timerArray.get(ShiroUtils.getSessionId());
+            timerCurrent.cancel();
+            timerArray.remove(ShiroUtils.getSessionId());
+        }
+        log.info("退出指令发送:sessionId:"+ShiroUtils.getSessionId());
+    }
+}

+ 62 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIndexController.java

@@ -284,10 +284,10 @@ public class SysIndexController extends BaseController
         mmap.put("rightThreeList",rightThreeList);
 //        return "mainLhk";
 //        return "main";
-//        return "mainYining";
+        return "mainYining";
 //        return "mainDangyang";
 //        return "mainJiangjin";
-        return "mainBaokang";
+//        return "mainBaokang";
     }
 
 
@@ -514,6 +514,66 @@ public class SysIndexController extends BaseController
         return "mainDangyangView";
     }
 
+    //伊宁相关
+    //TODO 获取当前用户的档案列表
+    @PostMapping("/system/yiningUserRelate")
+    @ResponseBody
+    public AjaxResult yiningUserRelate(){
+        UserRelate userRelate = new UserRelate();
+        userRelate.setUserId(getUserId());
+        List<UserRelate> userRelates = userRelateService.selectUserRelateList(userRelate);
+        //获取档案列表
+        //23年2月14日新增,加入档案信息
+        if(!CollectionUtils.isEmpty(userRelates)) {
+            for (UserRelate relate : userRelates) {
+                Dangan dangan = danganService.selectDanganById(relate.getDanganId());
+                if(!ObjectUtils.isEmpty(dangan)){
+                    if(!StringUtils.isEmpty(dangan.getIconInfo())){
+                        if(dangan.getIconInfo().contains("/upload")){
+                            //期望给用户展示用的可直接访问的URL
+                            String newStr = dangan.getIconInfo();
+                            String[] ipPorts = ipPort.split(",");
+                            //分ip+端口号 和 域名情况
+                            if(ipPorts.length>=2){
+                                //说明是由ip,端口组成的参数
+                                newStr = "http://"+ipPorts[0]+":"+ipPorts[1]+"/iconShow"+newStr;
+                            }else if(ipPorts.length==1){
+                                //说明ip配置的是域名
+                                newStr = "http://"+ipPorts[0]+"/iconShow"+newStr;
+                            }
+                            dangan.setIconInfo(newStr);
+                        }
+                    }else{
+                        //说明档案图标未上传,那么使用默认图标
+                        SysConfig configQuery = new SysConfig();
+                        configQuery.setConfigKey("sys.main.defaultIcon");
+                        SysConfig configEntity = configMapper.selectConfig(configQuery);
+                        if(!ObjectUtils.isEmpty(configEntity)) {
+                            String config = configEntity.getConfigValue();
+                            if (!StringUtils.isEmpty(config)) {
+                                //说明全局config表中已配置
+                                //期望给用户展示用的可直接访问的URL
+                                String newStr = config;
+//                                String[] ipPorts = ipPort.split(",");
+//                                //分ip+端口号 和 域名情况
+//                                if (ipPorts.length >= 2) {
+//                                    //说明是由ip,端口组成的参数
+//                                    newStr = "http://" + ipPorts[0] + ":" + ipPorts[1] + "/iconShow" + newStr;
+//                                } else if (ipPorts.length == 1) {
+//                                    //说明ip配置的是域名
+//                                    newStr = "http://" + ipPorts[0] + "/iconShow" + newStr;
+//                                }
+                                dangan.setIconInfo(newStr);
+                            }
+                        }
+                    }
+                    relate.setDangan(dangan);
+                }
+            }
+        }
+       return AjaxResult.success(userRelates);
+    }
+
     @GetMapping("/system/mainYiningView")
     public String mainYiningView(ModelMap mmap){
         mmap.put("version", RuoYiConfig.getVersion());

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -76,10 +76,10 @@ public class SysLoginController extends BaseController
         // 是否开启用户注册
         mmap.put("isAllowRegister", Convert.toBool(configService.getKey("sys.account.registerUser"), false));
 //        return "login";
-//        return "loginYining";
+        return "loginYining";
 //        return "loginDangyang";
 //        return "loginJiangjin";
-        return "loginBaokang";
+//        return "loginBaokang";
     }
 
     @PostMapping("/login")

+ 8 - 7
ruoyi-admin/src/main/resources/application-test.yml

@@ -58,18 +58,18 @@ spring:
 #                     username: postgres
 #                     password: lhk.postgres.2347
 #                     password: kpr.23417.postgres
-#                      url: jdbc:postgresql://140.246.183.164:5432/union_mgr_new?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
-#                      username: postgres
-#                      password: kpr.23417.postgres
+                      url: jdbc:postgresql://140.246.183.164:5432/union_mgr_new?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
+                      username: postgres
+                      password: kpr.23417.postgres
 #                      url: jdbc:postgresql://60.13.253.94:54321/union_mgr?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
 #                      username: postgres
 #                      password: kpr.23417.postgres
 #                      url: jdbc:postgresql://10.101.3.104:5432/union_mgr?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
 #                      username: postgres
 #                      password: kpr.23417.postgres
-                      url: jdbc:postgresql://111.170.129.106:5432/union_mgr?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
-                      username: postgres
-                      password: kpr.23417.postgres
+#                      url: jdbc:postgresql://111.170.129.106:5432/union_mgr?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull
+#                      username: postgres
+#                      password: kpr.23417.postgres
                 # 从库数据源
                 slave:
                     # 从数据源开关/默认关闭
@@ -123,4 +123,5 @@ spring:
 yiningCodeUrl: https://60.13.253.94:9000/base/apply/apk
 kpr.base.appinfo: https://60.13.253.94:9000/base/apply/apk-pkg
 mBLicenseSwitch: false
-shiro.config.globalSessionTimeout: -1
+shiro.config.globalSessionTimeout: -1
+sseUrl: http://127.0.0.1/sse/subscribe

+ 95 - 15
ruoyi-admin/src/main/resources/static/ruoyi/index.js

@@ -58,22 +58,102 @@ var quanjuChildWindow = [];
 document.getElementById('yiningLogoutLink').addEventListener('click', function(event) {
     // // 阻止默认的链接跳转行为
     event.preventDefault();
-    alert(111);
-    debugger
-
-    // // 如果需要,可以在这里进行其他操作,例如重定向
-    // window.location.href = this.href;
-    if(quanjuChildWindow.length>=1){
-        for(let i = 0;i<quanjuChildWindow.length;i++){
-            let childWindow = quanjuChildWindow[i];
-            // 确保子窗口加载完成后发送消息
-            childWindow.onload = function() {
-                // 使用 postMessage 向子窗口发送消息
-                childWindow.postMessage('log0ut', '*');
-            };
-        }
-    }
 
+    //TODO 本平台其他子系统
+    //TODO 首先调用登出指令通知所有通讯子系统
+    $.ajax({
+        url: ctx + "sse/logout",
+        type: "GET",
+        data: {},
+        success: function (result) {
+            console.log("发送登出通讯指令成功");
+        },
+        error: function(jqXHR, textStatus, errorThrown) {
+            console.error('POST请求失败:', textStatus, errorThrown);
+        }
+    });
+    
+    //TODO 其他第三方系统登出
+    $.ajax({
+        url:ctx+"system/yiningUserRelate",
+        type: "POST",
+        contentType: 'application/json', // 指定内容类型为JSON
+        data: {},
+        success: function(result) {
+            if (result.code === 0) {
+                let userRelate = result.data;
+                for (let i = 0;i<=userRelate.length;i++){
+                    if(userRelate[i] && userRelate[i].danganUrl && userRelate[i].danganName) {
+                        if ("伊宁供水大屏" === userRelate[i].danganName) {
+                            try {
+                                $.ajax({
+                                    url: "https://screen-manage.xjynwater.com/api/blade-auth/oauth/forceLogout" +
+                                    "?account=" + userRelate[i].danganLoginName, // 替换为实际的API端点
+                                    type: 'GET',
+                                    data: {},
+                                    success: function(response) {
+                                        console.log('伊宁供水大屏GET请求成功:', response);
+                                    },
+                                    error: function(jqXHR, textStatus, errorThrown) {
+                                        console.error('GET请求失败:', textStatus, errorThrown);
+                                    }
+                                });
+                            } catch (error) {
+                                console.log("伊宁供水大屏登出:" + error)
+                            }
+                        } else if ("水质实验室" === userRelate[i].danganName) {
+                            try {
+                                $.ajax({
+                                    url: "https://wql.xjynwater.com/api/blade-auth/oauth/forceLogout" +
+                                    "?account=" + userRelate[i].danganLoginName, // 替换为实际的API端点
+                                    type: 'GET',
+                                    data: {},
+                                    success: function(response) {
+                                        console.log('水质实验室GET请求成功:', response);
+                                    },
+                                    error: function(jqXHR, textStatus, errorThrown) {
+                                        console.error('GET请求失败:', textStatus, errorThrown);
+                                    }
+                                });
+                            } catch (error) {
+                                console.log("水质实验室登出:" + error)
+                            }
+                        } else if (userRelate[i].danganUrl.indexOf("https://office.xjynwater.com")!==-1) {
+                            //TODO 方格
+                            try {
+                                $.ajax({
+                                    url: "https://office.xjynwater.com/api/gridinter-uaa/auth/logoutByAccount?account="
+                                    + userRelate[i].danganLoginName, // 替换为实际的API端点
+                                    type: 'GET',
+                                    data: {},
+                                    success: function(response) {
+                                        console.log('方格GET请求成功:', response);
+                                    },
+                                    error: function(jqXHR, textStatus, errorThrown) {
+                                        console.error('GET请求失败:', textStatus, errorThrown);
+                                    }
+                                });
+                            } catch (error) {
+                                console.log("方格相关系统登出:" + error)
+                            }
+                        }
+                    }
+                }
+            }else{
+                //TODO 说明没有查到档案信息
+                location.reload();
+            }
+            // window.open("/logout",'_self');
+        },
+        error: function(jqXHR, textStatus, errorThrown) {
+            console.error('POST请求失败:', textStatus, errorThrown);
+        }
+    });
+    $.modal.loading("正在退出登录,请稍后...");
+    setTimeout(function () {
+        $.modal.closeLoading();
+        window.open("/logout",'_self');
+    },2000);
 });
 
 $(function() {

+ 1 - 1
ruoyi-admin/src/main/resources/templates/index-topnav.html

@@ -7,7 +7,7 @@
     <title>智慧水务系统-认证系统首页</title>
     <!-- 避免IE使用兼容模式 -->
  	<meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link th:href="@{faviconOld.ico}" rel="shortcut icon"/>
+    <link th:href="@{favicon.ico}" rel="shortcut icon"/>
     <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
     <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/index.html

@@ -7,7 +7,7 @@
     <title>智慧水务系统-认证系统首页</title>
     <!-- 避免IE使用兼容模式 -->
  	<meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link th:href="@{faviconOld.ico}" rel="shortcut icon"/>
+    <link th:href="@{favicon.ico}" rel="shortcut icon"/>
     <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
     <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
@@ -52,7 +52,7 @@
         </div>
         <a th:href="@{/index}">
             <li class="logo hidden-xs" style="width: 100%!important;height: 60px!important;background-color: rgb(4,35,61)!important;padding-top: 3%">
-				<img th:src="@{faviconOld.ico}" style="height: 60%;display: inline-block"/>
+				<img th:src="@{favicon.ico}" style="height: 60%;display: inline-block"/>
                 <span class="" style="font-weight: bold">统一认证平台</span>
             </li>
          </a>

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
ruoyi-admin/src/main/resources/templates/lock.html


+ 1 - 1
ruoyi-admin/src/main/resources/templates/login.html

@@ -14,7 +14,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
     <script>
         if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};

+ 1 - 1
ruoyi-admin/src/main/resources/templates/loginBaokang.html

@@ -18,7 +18,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
     <script>
         if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};

+ 1 - 1
ruoyi-admin/src/main/resources/templates/loginDangyang.html

@@ -18,7 +18,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
     <script>
         if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};

+ 1 - 1
ruoyi-admin/src/main/resources/templates/loginJiangjin.html

@@ -18,7 +18,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
     <script>
         if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};

+ 1 - 1
ruoyi-admin/src/main/resources/templates/loginYining.html

@@ -18,7 +18,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
     <script>
         if(window.top!==window.self){alert('未登录或登录超时。请重新登录');window.top.location=window.location};

+ 1 - 1
ruoyi-admin/src/main/resources/templates/main.html

@@ -5,7 +5,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/mainBaokang.html

@@ -2,12 +2,12 @@
 <html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="utf-8">
-	<link rel="shortcut icon" href="../static/images/faviconOld.ico" type="image/icon">
+	<link rel="shortcut icon" href="../static/images/favicon.ico" type="image/icon">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/mainBaokangView.html

@@ -5,7 +5,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/mainBaokang.css" th:href="@{/css/mainBaokang.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/mainDangyang.html

@@ -2,12 +2,12 @@
 <html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="utf-8">
-	<link rel="shortcut icon" href="../static/images/faviconOld.ico" type="image/icon">
+	<link rel="shortcut icon" href="../static/images/favicon.ico" type="image/icon">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/mainDangyangView.html

@@ -5,7 +5,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/mainYining.css" th:href="@{/css/mainYining.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/mainJiangjin.html

@@ -2,12 +2,12 @@
 <html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="utf-8">
-	<link rel="shortcut icon" href="../static/images/faviconOld.ico" type="image/icon">
+	<link rel="shortcut icon" href="../static/images/favicon.ico" type="image/icon">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/mainJiangjinView.html

@@ -5,7 +5,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/mainJiangjin.css" th:href="@{/css/mainJiangjin.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/mainLhk.html

@@ -2,12 +2,12 @@
 <html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="utf-8">
-	<link rel="shortcut icon" href="../static/images/faviconOld.ico" type="image/icon">
+	<link rel="shortcut icon" href="../static/images/favicon.ico" type="image/icon">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/mainYining.html

@@ -2,12 +2,12 @@
 <html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="utf-8">
-	<link rel="shortcut icon" href="../static/images/faviconOld.ico" type="image/icon">
+	<link rel="shortcut icon" href="../static/images/favicon.ico" type="image/icon">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
 	<link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/mainYiningMaskView.html

@@ -5,7 +5,7 @@
     <title></title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <!--360浏览器优先以webkit内核解析-->
-    <link rel="shortcut icon" href="faviconOld.ico">
+    <link rel="shortcut icon" href="favicon.ico">
     <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link href="../static/css/mainYining.css" th:href="@{/css/mainYining.css}" rel="stylesheet"/>
     <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>

+ 32 - 7
ruoyi-admin/src/main/resources/templates/mainYiningView.html

@@ -5,7 +5,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<!--360浏览器优先以webkit内核解析-->
 	<title></title>
-	<link rel="shortcut icon" href="faviconOld.ico">
+	<link rel="shortcut icon" href="favicon.ico">
 	<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
 	<link href="../static/css/mainYining.css" th:href="@{/css/mainYining.css}" rel="stylesheet"/>
 	<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
@@ -204,13 +204,10 @@
         }else{
 		    url = url + "?"+"reqid=" + sessionId;
 		}
+		url = url + "&" + "clientId="+ sessionId + new Date().getTime();
 
-
-		console.log(url)
-
-		let childWindow = window.open(url)
-        console.log(quanjuChildWindow);
-        window.top.quanjuChildWindow.push({"url":url,"childWindow":childWindow});
+		console.log(url);
+        window.open(url);
 	}
 
 		//TODO div与空白处点击事件
@@ -379,6 +376,34 @@
                 // $("#showMenuEsc").hide();
             }
 		}
+
+	//TODO sse测试
+    /*const clientId = 'uniqueClientId123'; // This should be unique for each client
+    const eventSource = new EventSource("/sse/subscribe?clientId="+clientId);
+
+    eventSource.onmessage = function(event) {
+        const newElement = document.createElement("div");
+        newElement.textContent = "Message: "+event.data;
+        console.log(newElement.textContent);
+    };
+
+    eventSource.addEventListener('heart', function(event) {
+        const newElement = document.createElement("div");
+        newElement.textContent = "Logout Event:"+event.data;
+        console.log(newElement.textContent);
+    }, false);
+
+    eventSource.addEventListener('logout', function(event) {
+        const newElement = document.createElement("div");
+        newElement.textContent = "Logout Event:"+event.data;
+        console.log(newElement.textContent);
+    }, false);
+
+    eventSource.onerror = function() {
+        const newElement = document.createElement("div");
+        newElement.textContent = "An error occurred!";
+        console.log(newElement.textContent);
+    };*/
 </script>
 </body>
 </html>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/main_v1.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>统计</title>
-    <link rel="shortcut icon" href="faviconOld.ico">
+    <link rel="shortcut icon" href="favicon.ico">
     <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
     <link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/register.html

@@ -14,7 +14,7 @@
     <meta name="renderer" content="webkit">
     <!-- 避免IE使用兼容模式 -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <style type="text/css">label.error { position:inherit;  }</style>
 </head>
 <body class="signin">

+ 1 - 1
ruoyi-admin/src/main/resources/templates/skin.html

@@ -8,7 +8,7 @@
     <!--[if lt IE 9]>
     <meta http-equiv="refresh" content="0;ie.html"/>
     <![endif]-->
-    <link rel="shortcut icon" href="../static/faviconOld.ico" th:href="@{faviconOld.ico}"/>
+    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
     <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link th:href="@{/css/style.min.css}" rel="stylesheet"/>
     <style type="text/css">

+ 3 - 3
ruoyi-admin/src/main/resources/templates/view.html

@@ -3,13 +3,13 @@
 
 <head>
     <meta charset="utf-8">
-    <link rel="shortcut icon" href="./static/images/faviconOld.ico" type="image/icon">
+    <link rel="shortcut icon" href="./static/images/favicon.ico" type="image/icon">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
-    <link rel="icon" href="./static/faviconOld.ico">
+    <link rel="icon" href="./static/favicon.ico">
     <title>老河口清源供水有限公司</title>
 
-    <link rel="shortcut icon" href="faviconOld.ico">
+    <link rel="shortcut icon" href="favicon.ico">
     <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
     <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
     <link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>

+ 4 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java

@@ -287,7 +287,7 @@ public class ShiroConfig
         // Shiro连接约束配置,即过滤链的定义
         LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
         // 对静态资源设置匿名访问
-        filterChainDefinitionMap.put("/faviconOld.ico**", "anon");
+        filterChainDefinitionMap.put("/favicon.ico**", "anon");
         filterChainDefinitionMap.put("/ruoyi.png**", "anon");
         filterChainDefinitionMap.put("/html/**", "anon");
         filterChainDefinitionMap.put("/css/**", "anon");
@@ -309,6 +309,9 @@ public class ShiroConfig
         filterChainDefinitionMap.put("/login", "anon,captchaValidate");
         filterChainDefinitionMap.put("/loginApp", "anon,captchaValidate");
         filterChainDefinitionMap.put("/upApp", "anon,captchaValidate");
+        filterChainDefinitionMap.put("/sse/subscribe", "anon,captchaValidate");
+//        filterChainDefinitionMap.put("/sse/logout", "anon,captchaValidate");
+        filterChainDefinitionMap.put("/sse/geturl", "anon,captchaValidate");
         // 注册相关
         filterChainDefinitionMap.put("/register", "anon,captchaValidate");
         // 系统权限列表