From a0c0b3e96fbd1e79aa89202289c73f8db2543e14 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Tue, 11 Jun 2024 11:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E9=9F=B3=E8=AF=86?= =?UTF-8?q?=E5=88=AB=20=E5=8F=8A=E7=AE=A1=E6=8E=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/commonRequest.js | 8 ++++++-- js/login/login.js | 1 + js/publics/public.js | 20 +++++++++++++++++++- pages/home/navigation.html | 2 +- pages/web/index.html | 3 ++- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/api/commonRequest.js b/api/commonRequest.js index b2eebb8..4a7b7f2 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -1,8 +1,12 @@ let aqEnnable = true // 参数加密开关 //后端路径 -const commonUrl = "http://127.0.0.1:18080/zhgd/"; +const commonUrl = "http://36.33.26.201:19090/zhgd/"; //前端路径 -const URL_IP="http://10.138.225.233:21624/zhgd-web" +const URL_IP="http://36.33.26.201:21624/zhgd-web" + +// const commonUrl = "http://127.0.0.1:18080/zhgd/"; +// //前端路径 +// const URL_IP="http://10.138.225.233:21624/zhgd-web" /* 登录相关 */ const login_url = commonUrl + "auth/login"; // 登录url const login_out = commonUrl + "auth/logout"; // 登出url diff --git a/js/login/login.js b/js/login/login.js index bdca9b0..26de16e 100644 --- a/js/login/login.js +++ b/js/login/login.js @@ -26,6 +26,7 @@ layui.use(function () { sessionStorage.setItem("zhgd_token", result.data.access_token); sessionStorage.setItem("zhgd_us", result.data.us); const us = JSON.parse(result.data.us); + localStorage.setItem("zhgd_type-noLogin",us.jumpType); sessionStorage.setItem("zhgd_type", us.jumpType); if (us.jumpType === '2') { window.location.href = "pages/home/navigation.html"; diff --git a/js/publics/public.js b/js/publics/public.js index 5e8af4a..bb5e64a 100644 --- a/js/publics/public.js +++ b/js/publics/public.js @@ -1,6 +1,24 @@ const token = sessionStorage.getItem("zhgd_token"); const us = sessionStorage.getItem("zhgd_us"); -const zhgd_type = sessionStorage.getItem("zhgd_type"); +let zhgd_type = sessionStorage.getItem("zhgd_type"); +if(!us){ + if(!zhgd_type){ + zhgd_type=localStorage.getItem("zhgd_type-noLogin"); + } + if(!zhgd_type){ + zhgd_type=2; + } + backLoginPage(); +} +if(!token){ + if(!zhgd_type){ + zhgd_type=localStorage.getItem("zhgd_type-noLogin"); + } + if(!zhgd_type){ + zhgd_type=2; + } + backLoginPage(); +} const roleCode = JSON.parse(us).roleCode; const orgId = JSON.parse(us).orgId; const userId = JSON.parse(us).userId; diff --git a/pages/home/navigation.html b/pages/home/navigation.html index 3bf2ab2..57d415d 100644 --- a/pages/home/navigation.html +++ b/pages/home/navigation.html @@ -9,11 +9,11 @@ + -