From 779cd82197e41608b2899d298a5153582e336d85 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Thu, 12 Dec 2024 14:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B6=8A=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bns/html/compreDisplay/compreDisplay.html | 3 +- bns/html/compreDisplay/dutyHome.html | 7 ++--- bns/js/dutyTask/remotePatrol/remotePatrol.js | 3 -- bns/js/public/public.js | 6 +--- bns/js/system/htmlpermission.js | 29 ++++++++++++++++++++ logins.html | 8 +++++- 6 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 bns/js/system/htmlpermission.js diff --git a/bns/html/compreDisplay/compreDisplay.html b/bns/html/compreDisplay/compreDisplay.html index 3ff695f..9c64515 100644 --- a/bns/html/compreDisplay/compreDisplay.html +++ b/bns/html/compreDisplay/compreDisplay.html @@ -8,8 +8,9 @@ - + + diff --git a/bns/html/compreDisplay/dutyHome.html b/bns/html/compreDisplay/dutyHome.html index 628aa3b..d87b6e4 100644 --- a/bns/html/compreDisplay/dutyHome.html +++ b/bns/html/compreDisplay/dutyHome.html @@ -11,16 +11,15 @@ - + - + - - + diff --git a/bns/js/dutyTask/remotePatrol/remotePatrol.js b/bns/js/dutyTask/remotePatrol/remotePatrol.js index 854fce6..a3931c1 100644 --- a/bns/js/dutyTask/remotePatrol/remotePatrol.js +++ b/bns/js/dutyTask/remotePatrol/remotePatrol.js @@ -168,9 +168,6 @@ function pages() { classId: idParam } $.ajax({ - headers:{ - "encryption":"encryption" - }, url: dataUrl + "proteam/pot/todayTask/getBallTimeList" , data: params, dataType:'JSON', diff --git a/bns/js/public/public.js b/bns/js/public/public.js index 6b58bf5..af50f70 100644 --- a/bns/js/public/public.js +++ b/bns/js/public/public.js @@ -5,7 +5,7 @@ let isIgwLogin = localStorage.getItem("isIgwLogin"); let webSocketUrl = dataUrl.replace("http", "ws") + 'proteam/websocket/1?token='+token //getVideoConfig(token); //获取路径 -getLocalpath(); + /*系统登出*/ function logout(type) { let html_type = localStorage.getItem("html_type"); @@ -410,7 +410,3 @@ function setRiskLevelColor(value) { } } -function getLocalpath(){ - var currentPath = window.location.pathname; - console.log(currentPath); // 输出当前页面的路径 -} \ No newline at end of file diff --git a/bns/js/system/htmlpermission.js b/bns/js/system/htmlpermission.js new file mode 100644 index 0000000..4ca6105 --- /dev/null +++ b/bns/js/system/htmlpermission.js @@ -0,0 +1,29 @@ +getLocalpath(); + +function getLocalpath(){ + var currentPath = window.location.pathname; + var url=currentPath.split("/html"); + let usJosn=JSON.parse(us); + let yq=getHtmlPermission(usJosn.menus,url[1]); + console.log(yq) + if(!yq){ + console.log(url[1]) + top.window.location.href = login_url; + } +} +function getHtmlPermission(menus,html){ + for (var i = 0; i < menus.length; i++) { + var child=menus[i].childer; + if(!child || child.length<1){ + if(menus[i].url.indexOf(html)!='-1'){ + return true; + } + }else{ + let wyq=getHtmlPermission(child,html); + if(wyq){ + return true; + } + } + } + return false; +} \ No newline at end of file diff --git a/logins.html b/logins.html index d423f2f..05edd13 100644 --- a/logins.html +++ b/logins.html @@ -8,8 +8,14 @@ + + + + + + + -