省侧基建智慧现场工地
基建智慧现场工地
diff --git a/api/commonRequest.js b/api/commonRequest.js index 4a7b7f2..d0aa056 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -1,16 +1,18 @@ let aqEnnable = true // 参数加密开关 //后端路径 -const commonUrl = "http://36.33.26.201:19090/zhgd/"; -//前端路径 -const URL_IP="http://36.33.26.201:21624/zhgd-web" - -// const commonUrl = "http://127.0.0.1:18080/zhgd/"; +// const commonUrl = "http://27.50.49.56:18080/zhgd/"; +// const URL_IP="http://27.50.49.56:21624/zhgd-web" +//前端 +const URL_IP="http://127.0.0.1:63343/ah_jjzhgd_webscreen" + const commonUrl = "http://127.0.0.1:18080/zhgd/"; // //前端路径 -// const URL_IP="http://10.138.225.233:21624/zhgd-web" +let isc_login="http://iscssotest.ah.sgcc.com.cn/isc_sso/login?service="; /* 登录相关 */ const login_url = commonUrl + "auth/login"; // 登录url const login_out = commonUrl + "auth/logout"; // 登出url const page_jump = commonUrl + "auth/pageJump"; // 登出url + + const login_sg_page = URL_IP+"/sg_login.html" // 施工大屏登录页面 const login_sc_page = URL_IP+"/sc_login.html" // 省侧大屏登录页面 const login_sg_index = URL_IP+"/pages/home/navigation.html" // 施工大屏首页 diff --git a/js/login/login.js b/js/login/login.js index 26de16e..b566472 100644 --- a/js/login/login.js +++ b/js/login/login.js @@ -1,5 +1,9 @@ let form, layer; layui.use(function () { + let logUrl="http://27.50.49.56:21624/zhgd-web/scIndex.html"; + let isc_login="http://iscssotest.ah.sgcc.com.cn/isc_sso/login?service="; + window.location.href =isc_login+logUrl; + return false; form = layui.form; layer = layui.layer; form.on('submit(demo-login)', function (data) { @@ -17,6 +21,7 @@ layui.use(function () { "loginType": loginType } let encryptStr = encryptCBC(JSON.stringify(params)); + console.log(encryptStr) ajaxRequest(login_url, "POST", encryptStr, true, function () { // $('.layui-btn-fluid').empty().append('登录中,请稍后...').attr("disabled", true); }, function (result) { @@ -28,6 +33,7 @@ layui.use(function () { const us = JSON.parse(result.data.us); localStorage.setItem("zhgd_type-noLogin",us.jumpType); sessionStorage.setItem("zhgd_type", us.jumpType); + // window.location.href = "http://localhost:9528/#/ywgllogin?ticket=5555"; if (us.jumpType === '2') { window.location.href = "pages/home/navigation.html"; } else if (us.jumpType === '1') { diff --git a/js/login/login2.js b/js/login/login2.js new file mode 100644 index 0000000..9a2d753 --- /dev/null +++ b/js/login/login2.js @@ -0,0 +1,63 @@ +let form, layer; +layui.use(function () { + let isc_login="http://iscssotest.ah.sgcc.com.cn/isc_sso/login?service="; + let logUrl="http://27.50.49.56:21624/zhgd-web/sgIndex.html"; + // window.location.href =isc_login+logUrl; + // return false; + form = layui.form; + layer = layui.layer; + form.on('submit(demo-login)', function (data) { + let field = data.field; + let loginType = ""; + let hrefUrl = window.location.href; + if (hrefUrl && hrefUrl.indexOf("sg_login") > 0) { + loginType = "2" + } else if (hrefUrl && hrefUrl.indexOf("sc_login") > 0) { + loginType = "1" + } + const params = { + "username": field.username, + "password": field.password, + "loginType": loginType + } + let encryptStr = encryptCBC(JSON.stringify(params)); + ajaxRequest(login_url, "POST", encryptStr, true, function () { + // $('.layui-btn-fluid').empty().append('登录中,请稍后...').attr("disabled", true); + }, function (result) { + // $('.layui-btn-fluid').empty().append(' '); + if (result.code === 200) { + top.layer.msg(result.msg, { icon: 1, time: 500 }, 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); + // window.location.href = "http://localhost:9528/#/ywgllogin?ticket=5555"; + if (us.jumpType === '2') { + window.location.href = "pages/home/navigation.html"; + } else if (us.jumpType === '1') { + window.location.href = "pages/web/index.html"; + } + }); + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + }else if (result.code === 201) { + layer.msg(result.msg, { icon: 2 }); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + $('.layui-btn-fluid').empty().append('登 录'); + }, "application/json", aqEnnable); + }); +}); + +/* 请求错误 */ +function errorFn(xhr, status, error) { + if (xhr.status === 0) { + // 网络连接失败 + console.error("网络连接失败,请检查网络是否正常"); + } else { + // 请求出现其他错误 + console.error("ajax请求错误:" + error); + } +} \ No newline at end of file diff --git a/js/operEnvironment/operEnvironment.js b/js/operEnvironment/operEnvironment.js index 7f87300..3aa20f7 100644 --- a/js/operEnvironment/operEnvironment.js +++ b/js/operEnvironment/operEnvironment.js @@ -14,7 +14,7 @@ layui.use(['layer', 'element', 'table'], function () { DaylightDisplacementList(''); DaylightDisplacementApi(); //和风天气API调用 - zephyrineWeather(); + // zephyrineWeather(); //有限空间 LimitedSpaceApi(); //GPS安装检测 diff --git a/js/pages/home/navigation.js b/js/pages/home/navigation.js index e1ec3b2..513fa97 100644 --- a/js/pages/home/navigation.js +++ b/js/pages/home/navigation.js @@ -199,10 +199,10 @@ function setMenusData(data) { } else if (index !== 0 && item.menuName !== '数据操作') { html += '
' + item.menuName + '
' + item.menuName + '
' + item.menuName + '
安全帽
安全帽
省侧基建智慧现场工地
基建智慧现场工地