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 + '

  • ' } else if (item.menuName === '数据操作') { - html += '
  • ' + item.menuName + '

  • ' + // html += '
  • ' + item.menuName + '

  • ' } }) - html += '
  • 安全帽

  • ' + // html += '
  • 安全帽

  • ' } $('#nav-right ul').empty().append(html); } diff --git a/js/personnelControl/personnelControl.js b/js/personnelControl/personnelControl.js index 77049d7..ab12203 100644 --- a/js/personnelControl/personnelControl.js +++ b/js/personnelControl/personnelControl.js @@ -12,7 +12,7 @@ layui.use(['layer', 'element', 'table', 'tree'], function () { window.location.href = "../personnelControl/personnelControlList.html"; }); - mapInit(); + // mapInit(); //人员列表 PersonnelList(); diff --git a/js/publics/public.js b/js/publics/public.js index bb5e64a..54fa218 100644 --- a/js/publics/public.js +++ b/js/publics/public.js @@ -58,10 +58,11 @@ function loginout(type) { sessionStorage.removeItem("zhgd_token"); sessionStorage.removeItem("zhgd_us"); sessionStorage.removeItem("zhgd_type"); + let iscId=localStorage.getItem("iscKey"); if (zhgd_type === "2") { - top.location.href = login_sg_page; + window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:21624/zhgd-web/sg_login.html'; } else if (zhgd_type === "1") { - top.location.href = login_sc_page; + window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:21624/zhgd-web/sc_login.html'; } }); } else if (result.code === 500) { @@ -87,12 +88,15 @@ function errorFn(xhr, status, error) { /* 返回登录页 */ function backLoginPage() { + let iscId=localStorage.getItem("iscKey"); if (zhgd_type === "2") { - top.location.href = login_sg_page; + window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:21624/zhgd-web/sg_login.html'; + } else if (zhgd_type === "1") { - top.location.href = login_sc_page; + window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:21624/zhgd-web/sc_login.html'; + }else { - top.location.href = login_sc_page; + window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:21624/zhgd-web/sc_login.html'; } } //判断字符是否为空的方法 diff --git a/pages/operEnvironment/operEnvironment.html b/pages/operEnvironment/operEnvironment.html index 6242a9c..7d893b0 100644 --- a/pages/operEnvironment/operEnvironment.html +++ b/pages/operEnvironment/operEnvironment.html @@ -13,7 +13,7 @@ - + 作业环境 diff --git a/pages/personnelControl/personnelControl.html b/pages/personnelControl/personnelControl.html index aedcaf9..6e8b996 100644 --- a/pages/personnelControl/personnelControl.html +++ b/pages/personnelControl/personnelControl.html @@ -13,9 +13,9 @@ - + + - diff --git a/scIndex.html b/scIndex.html new file mode 100644 index 0000000..f5c6a3f --- /dev/null +++ b/scIndex.html @@ -0,0 +1,246 @@ + + + + + + Loading Page + + + +
    +
    +
    +
    +
    +
    正在加载系统资源,请耐心等待
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/sc_login.html b/sc_login.html index d42b3c8..a1d3226 100644 --- a/sc_login.html +++ b/sc_login.html @@ -11,11 +11,11 @@ - 登录 + 登录, - -
    + +

    省侧基建智慧现场工地

    diff --git a/sgIndex.html b/sgIndex.html new file mode 100644 index 0000000..72957e0 --- /dev/null +++ b/sgIndex.html @@ -0,0 +1,247 @@ + + + + + + Loading Page + + + +
    +
    +
    +
    +
    +
    正在加载系统资源,请耐心等待
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/sg_login.html b/sg_login.html index af49dc1..1dae28f 100644 --- a/sg_login.html +++ b/sg_login.html @@ -14,8 +14,8 @@ 登录 - -
    + +

    基建智慧现场工地

    @@ -47,6 +47,6 @@
    - + \ No newline at end of file