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 @@ + - 基建现场智慧工地 diff --git a/pages/web/index.html b/pages/web/index.html index 5c9a0f4..74e4ca9 100644 --- a/pages/web/index.html +++ b/pages/web/index.html @@ -9,9 +9,10 @@ + - +