Bladeren bron

增加中控调度和SCADA子系统登出

欧阳劲驰 3 maanden geleden
bovenliggende
commit
14766a17c6

+ 33 - 0
ruoyi-admin/src/main/resources/static/ruoyi/index.js

@@ -64,6 +64,9 @@ function quitSystem() {
     if(sessionStorage.getItem("reqids")){
         reqids = JSON.parse(sessionStorage.getItem("reqids"));
     }
+    //获取reqid
+    const reqid = sessionStorage.getItem("reqid");
+
     $.ajax({
         url: ctx + "sse/logout",
         type: "POST",
@@ -163,6 +166,36 @@ function quitSystem() {
                             } catch (error) {
                                 console.log("方格相关系统登出:" + error)
                             }
+                        } else if ("中控调度" === userRelate[i].danganName) {
+                            //中控调度登出
+                            try {
+                                //请求登出
+                                if (reqid) $.ajax({
+                                    url: "https://ccs.xjynwater.com/prod-api/uni/uniLogout" +
+                                        "?choiceType=1" +
+                                        "&reqid=" + reqid,
+                                    type: 'GET',
+                                    success: response => console.log('中控调度登出请求成功:', response),
+                                    error: (jqXHR, textStatus, errorThrown) => console.error('中控调度登出请求失败:', textStatus, errorThrown)
+                                });
+                            } catch (error) {
+                                console.log("中控调度登出请求失败:" + error)
+                            }
+                        }  else if ("SCADA" === userRelate[i].danganName) {
+                            //SCADA登出
+                            try {
+                                //请求登出
+                                if (reqid) $.ajax({
+                                    url: "https://ccs.xjynwater.com/prod-api/uni/uniLogout" +
+                                        "?choiceType=2" +
+                                        "&reqid=" + reqid,
+                                    type: 'GET',
+                                    success: response => console.log('SCADA登出请求成功:', response),
+                                    error: (jqXHR, textStatus, errorThrown) => console.error('SCADA登出请求失败:', textStatus, errorThrown)
+                                });
+                            } catch (error) {
+                                console.log("SCADA登出请求失败:" + error)
+                            }
                         }
                     }
                 }

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

@@ -196,6 +196,7 @@
 
 	var sessionId = [[${sessionId}]];
 	console.log("伊宁会话:"+sessionId);
+	sessionStorage.setItem("reqid",sessionId);
 
 	function opennewpage(url) {