diff --git a/api/commonRequest.js b/api/commonRequest.js index 22c4448..d44b516 100644 --- a/api/commonRequest.js +++ b/api/commonRequest.js @@ -1,5 +1,5 @@ -let aqEnnable = true // 参数加密开关 -const commonUrl = "http://10.40.92.105:18080/zhgd/"; +let aqEnnable = false // 参数加密开关 +const commonUrl = "http://10.40.92.33:18080/zhgd/"; /* 登录相关 */ const login_url = commonUrl + "auth/login"; // 登录url const login_out = commonUrl + "auth/logout"; // 登出url @@ -10,7 +10,7 @@ const login_sg_index = "http://10.40.92.33:8100/pages/home/navigation.html" // const login_sc_index = "http://10.40.92.33:8101/pages/web/index.html" // 省侧大屏首页 /* POST 请求 */ -function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType,isAes) { +function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType, isAes) { $.ajax({ url: url, type: type, @@ -33,7 +33,8 @@ function ajaxRequest2(url, type, token, successFn, errorFn) { url: url, type: type, headers: { - "authorization": token + "authorization": token, + "decrypt": 'decrypt' }, success: successFn, error: errorFn @@ -66,9 +67,9 @@ function ajaxRequestGetExport(url, type, async, beforeFn, successFn, errorFn, is "authorization": sessionStorage.getItem("zhgd_token"), "decrypt": isAes ? '' : 'decrypt' }, - xhrFields: { - responseType: 'blob' // 告诉 xhr 我们期望返回的数据类型是 blob - }, + xhrFields: { + responseType: 'blob' // 告诉 xhr 我们期望返回的数据类型是 blob + }, async: async, beforeSend: beforeFn, success: successFn, diff --git a/js/login/login.js b/js/login/login.js index 574f2bd..be85304 100644 --- a/js/login/login.js +++ b/js/login/login.js @@ -18,8 +18,8 @@ layui.use(function () { } let encryptStr = encryptCBC(JSON.stringify(params)); ajaxRequest(login_url, "POST", encryptStr, true, function () { + $('.layui-btn-fluid').empty().append('登录中,请稍后...').attr("disabled", true); }, function (result) { - console.log(result); if (result.code === 200) { top.layer.msg(result.msg, { icon: 1, time: 500 }, function () { sessionStorage.setItem("zhgd_token", result.data.access_token); @@ -37,6 +37,7 @@ layui.use(function () { } }, function (xhr, status, error) { error(xhr, status, error) - }, "application/json",aqEnnable); + $('.layui-btn-fluid').empty().append('登 录'); + }, "application/json", aqEnnable); }); }); \ No newline at end of file diff --git a/js/pages/home/navigation.js b/js/pages/home/navigation.js index 0f0598e..642423c 100644 --- a/js/pages/home/navigation.js +++ b/js/pages/home/navigation.js @@ -7,6 +7,7 @@ layui.use(['layer', 'element'], function () { const bidCodeParam = GetQueryString('bidCode'); const tokenParam = GetQueryString('token'); if (bidCodeParam && tokenParam) { + aqEnnable = !aqEnnable ? true : true; // 省侧大屏跳转施工大屏 调用后台返回用户信息 bidCode = decryptCBC(bidCodeParam); const token = decryptCBC(tokenParam); @@ -68,18 +69,25 @@ function reloadMenuData(us, bidCode) { } /* 初始化菜单 */ -function setMenusData(menus) { - let html = ''; - if (menus && menus.length > 0) { - $.each(menus[0].childer, function (index, item) { - if (index === 0) { - html += '
' + item.menuName + '
' + item.menuName + '
' + item.menuName + '
' + item.menuName + '
' + item.menuName + '