This commit is contained in:
parent
a3fbe4fdc8
commit
1220d5c800
|
|
@ -1,5 +1,5 @@
|
||||||
let aqEnnable = true // 参数加密开关
|
let aqEnnable = false // 参数加密开关
|
||||||
const commonUrl = "http://10.40.92.105:18080/zhgd/";
|
const commonUrl = "http://10.40.92.33:18080/zhgd/";
|
||||||
/* 登录相关 */
|
/* 登录相关 */
|
||||||
const login_url = commonUrl + "auth/login"; // 登录url
|
const login_url = commonUrl + "auth/login"; // 登录url
|
||||||
const login_out = commonUrl + "auth/logout"; // 登出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" // 省侧大屏首页
|
const login_sc_index = "http://10.40.92.33:8101/pages/web/index.html" // 省侧大屏首页
|
||||||
|
|
||||||
/* POST 请求 */
|
/* POST 请求 */
|
||||||
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType,isAes) {
|
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType, isAes) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: type,
|
type: type,
|
||||||
|
|
@ -33,7 +33,8 @@ function ajaxRequest2(url, type, token, successFn, errorFn) {
|
||||||
url: url,
|
url: url,
|
||||||
type: type,
|
type: type,
|
||||||
headers: {
|
headers: {
|
||||||
"authorization": token
|
"authorization": token,
|
||||||
|
"decrypt": 'decrypt'
|
||||||
},
|
},
|
||||||
success: successFn,
|
success: successFn,
|
||||||
error: errorFn
|
error: errorFn
|
||||||
|
|
@ -66,9 +67,9 @@ function ajaxRequestGetExport(url, type, async, beforeFn, successFn, errorFn, is
|
||||||
"authorization": sessionStorage.getItem("zhgd_token"),
|
"authorization": sessionStorage.getItem("zhgd_token"),
|
||||||
"decrypt": isAes ? '' : 'decrypt'
|
"decrypt": isAes ? '' : 'decrypt'
|
||||||
},
|
},
|
||||||
xhrFields: {
|
xhrFields: {
|
||||||
responseType: 'blob' // 告诉 xhr 我们期望返回的数据类型是 blob
|
responseType: 'blob' // 告诉 xhr 我们期望返回的数据类型是 blob
|
||||||
},
|
},
|
||||||
async: async,
|
async: async,
|
||||||
beforeSend: beforeFn,
|
beforeSend: beforeFn,
|
||||||
success: successFn,
|
success: successFn,
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ layui.use(function () {
|
||||||
}
|
}
|
||||||
let encryptStr = encryptCBC(JSON.stringify(params));
|
let encryptStr = encryptCBC(JSON.stringify(params));
|
||||||
ajaxRequest(login_url, "POST", encryptStr, true, function () {
|
ajaxRequest(login_url, "POST", encryptStr, true, function () {
|
||||||
|
$('.layui-btn-fluid').empty().append('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>登录中,请稍后...').attr("disabled", true);
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
console.log(result);
|
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
top.layer.msg(result.msg, { icon: 1, time: 500 }, function () {
|
top.layer.msg(result.msg, { icon: 1, time: 500 }, function () {
|
||||||
sessionStorage.setItem("zhgd_token", result.data.access_token);
|
sessionStorage.setItem("zhgd_token", result.data.access_token);
|
||||||
|
|
@ -37,6 +37,7 @@ layui.use(function () {
|
||||||
}
|
}
|
||||||
}, function (xhr, status, error) {
|
}, function (xhr, status, error) {
|
||||||
error(xhr, status, error)
|
error(xhr, status, error)
|
||||||
}, "application/json",aqEnnable);
|
$('.layui-btn-fluid').empty().append('登 录');
|
||||||
|
}, "application/json", aqEnnable);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -7,6 +7,7 @@ layui.use(['layer', 'element'], function () {
|
||||||
const bidCodeParam = GetQueryString('bidCode');
|
const bidCodeParam = GetQueryString('bidCode');
|
||||||
const tokenParam = GetQueryString('token');
|
const tokenParam = GetQueryString('token');
|
||||||
if (bidCodeParam && tokenParam) {
|
if (bidCodeParam && tokenParam) {
|
||||||
|
aqEnnable = !aqEnnable ? true : true;
|
||||||
// 省侧大屏跳转施工大屏 调用后台返回用户信息
|
// 省侧大屏跳转施工大屏 调用后台返回用户信息
|
||||||
bidCode = decryptCBC(bidCodeParam);
|
bidCode = decryptCBC(bidCodeParam);
|
||||||
const token = decryptCBC(tokenParam);
|
const token = decryptCBC(tokenParam);
|
||||||
|
|
@ -68,18 +69,25 @@ function reloadMenuData(us, bidCode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 初始化菜单 */
|
/* 初始化菜单 */
|
||||||
function setMenusData(menus) {
|
function setMenusData(data) {
|
||||||
let html = '';
|
if (data && data.length > 0) {
|
||||||
if (menus && menus.length > 0) {
|
const menus = data.filter(item => {
|
||||||
$.each(menus[0].childer, function (index, item) {
|
return item.menuName === '施工大屏'
|
||||||
if (index === 0) {
|
|
||||||
html += '<li class="layout checked" hrefValue="' + item.url + '"><p>' + item.menuName + '</p></li>'
|
|
||||||
} else {
|
|
||||||
html += '<li class="layout nocheck" hrefValue="' + item.url + '"><p>' + item.menuName + '</p></li>'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
let html = '';
|
||||||
|
if (menus && menus.length > 0) {
|
||||||
|
$.each(menus[0].childer, function (index, item) {
|
||||||
|
if (index === 0 && item.menuName !== '数据操作') {
|
||||||
|
html += '<li class="layout checked" hrefValue="' + item.url + '"><p>' + item.menuName + '</p></li>'
|
||||||
|
} else if (index !== 0 && item.menuName !== '数据操作') {
|
||||||
|
html += '<li class="layout nocheck" hrefValue="' + item.url + '"><p>' + item.menuName + '</p></li>'
|
||||||
|
} else if (item.menuName === '数据操作') {
|
||||||
|
html += '<li class="layout nocheck" onclick="goBackground()"><p>' + item.menuName + '</p></li>'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$('#nav-right ul').empty().append(html);
|
||||||
}
|
}
|
||||||
$('#nav-right ul').empty().append(html);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 初始化用户绑定标段工程 */
|
/* 初始化用户绑定标段工程 */
|
||||||
|
|
@ -111,3 +119,17 @@ const GetQueryString = (name) => {
|
||||||
$('#nav-left button').on('click', function () {
|
$('#nav-left button').on('click', function () {
|
||||||
window.location.href = login_sc_index;
|
window.location.href = login_sc_index;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/* 跳转后台 */
|
||||||
|
function goBackground() {
|
||||||
|
aqEnnable = !aqEnnable ? true : true;
|
||||||
|
const params = {
|
||||||
|
'token': token
|
||||||
|
};
|
||||||
|
// 将参数转换为查询字符串
|
||||||
|
const queryString = Object.keys(params)
|
||||||
|
.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(encryptCBC(params[key])))
|
||||||
|
.join('&');
|
||||||
|
const hrefUrl = "http://10.40.92.113:9527/#/sso" + "?" + queryString;
|
||||||
|
const newWindow = window.open(hrefUrl,'newwindow');
|
||||||
|
}
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
<div id="nav-box" class="layout">
|
<div id="nav-box" class="layout">
|
||||||
<div id="nav-icon">
|
<div id="nav-icon">
|
||||||
<img src="../../img/navigation/logout.png" onclick="loginout()" alt="退出" data-mtpis="退出">
|
<img src="../../img/navigation/logout.png" onclick="loginout()" alt="退出" data-mtpis="退出">
|
||||||
<p style="color: #fff;" onclick="goSg()">点击跳转施工大屏</p>
|
<!-- <p style="color: #fff;" onclick="goSg()">点击跳转施工大屏</p> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="ifr-box">
|
<div id="ifr-box">
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item" style="margin-top: 8%;">
|
<div class="layui-form-item" style="margin-top: 8%;">
|
||||||
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">登 录</button>
|
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-login">
|
||||||
|
登 录</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue