Commit 09034193 authored by 朱建丰's avatar 朱建丰

二次鉴权

parent e7142040
......@@ -8,7 +8,7 @@
separator-class="el-icon-arrow-right"
>
<el-breadcrumb-item
><a href="https://szzf.qingtian.gov.cn:18080"
><a href="https://szzf.qingtian.gov.cn:18080" target="_parent"
>首页</a
></el-breadcrumb-item
>
......
......@@ -31,7 +31,8 @@
// 埋点初始化代码
(function (w, d, s, q, i) {
w[q] = w[q] || [];
var f = d.getElementsByTagName(s)[0], j = d.createElement(s);
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s);
j.async = true;
j.id = 'beacon-aplus';
j.src = 'https://alidt.alicdn.com/alilog/mlog/aplus_cloud.js';
......@@ -39,6 +40,7 @@
})(window, document, 'script', 'aplus_queue');
//适配pad
var view_timer = null;
function viewPort(userAgent, pageWidth) {
var oView = document.getElementById('viewport');
if (oView) {
......@@ -48,7 +50,7 @@
pageWidth = 1440;
}
var screen_w = parseInt(window.screen.width),
screen_h =parseInt(window.screen.height),
screen_h = parseInt(window.screen.height),
scale = screen_w / pageWidth;
if (/Android (\d+\.\d+)/.test(userAgent)) {
var creat_meta = document.createElement('meta');
......@@ -56,7 +58,9 @@
creat_meta.id = 'viewport';
var version = parseFloat(RegExp.$1);
if (version > 2.3) {
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale + ',user-scalable=1, minimum-scale = ' + scale + ', maximum-scale = ' + scale + ', target-densitydpi=device-dpi';
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale +
',user-scalable=1, minimum-scale = ' + scale + ', maximum-scale = ' + scale +
', target-densitydpi=device-dpi';
} else {
creat_meta.content = '"width=' + pageWidth + ', target-densitydpi=device-dpi';
}
......@@ -65,12 +69,14 @@
var creat_meta = document.createElement('meta');
creat_meta.name = 'viewport';
creat_meta.id = 'viewport';
if (window.orientation == '-90' || window.orientation == '90') {//判断移动设备横屏竖屏
if (window.orientation == '-90' || window.orientation == '90') { //判断移动设备横屏竖屏
scale = window.screen.height / pageWidth;
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale*screen_w/screen_h + ' ,minimum-scale = ' + scale*screen_w/screen_h + ', maximum-scale = ' + scale*screen_w/screen_h + ', user-scalable=no, target-densitydpi=device-dpi';
}
else {
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale + ' ,minimum-scale = ' + scale + ', maximum-scale = ' + scale + ', user-scalable=no, target-densitydpi=device-dpi';
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale * screen_w / screen_h +
' ,minimum-scale = ' + scale * screen_w / screen_h + ', maximum-scale = ' + scale * screen_w / screen_h +
', user-scalable=no, target-densitydpi=device-dpi';
} else {
creat_meta.content = 'width=' + pageWidth + ', initial-scale = ' + scale + ' ,minimum-scale = ' + scale +
', maximum-scale = ' + scale + ', user-scalable=no, target-densitydpi=device-dpi';
}
document.head.appendChild(creat_meta);
}
......@@ -82,13 +88,45 @@
viewPort(navigator.userAgent);
}, 500);
}
// window.addEventListener("message", function (e) {
// console.log(e);
// // let accessToken = e;
// let user = await fetch(
// `https://lsszzf.lishui.gov.cn:18082/common/login/getuserinfo.php`
// );
// });
window.addEventListener('message', async function (e, d) {
if (e.data && e.data.accessToken) {
var token = e.data.accessToken;
var url =
'https://portal.lishui.gov.cn:18080/api_2021/public/index.php/index/MicroPortalLogin/getUserInfoByAccessToken?token=' +token;
var user = await fetch(url);
var contentType = user.headers.get('Content-Type');
console.log(contentType);
console.log("return user");
console.log(user.json());
console.log("finishing");
} else {
window.location.replace("./#err");
}
// var data = JSON.parse(e.data);
// alert(data);
// var accessToken = data.accessToken;
// alert(accessToken);
//alert(e.data)
// let data = JSON.parse(e.data);
// let accessToken = data.accessToken;
})
</script>
</html>
\ No newline at end of file
</html>
......@@ -8,7 +8,7 @@
separator-class="el-icon-arrow-right"
>
<el-breadcrumb-item
><a href="https://szzf.qingtian.gov.cn:18080"
><a href="https://szzf.qingtian.gov.cn:18080" target="_parent"
>首页</a
></el-breadcrumb-item
>
......
......@@ -821,6 +821,7 @@ export default {
showTit: false,
};
},
mounted() {
let _this = this;
this.initGzbgChart();
......@@ -830,6 +831,7 @@ export default {
this.initGzbgChart5();
this.initGzbgChart6();
this.initGzbgChart7();
window.parent.postMessage(document.body.scrollHeight, '*');
window.onresize = () => {
return (() => {
_this.initGzbgChart();
......@@ -839,6 +841,7 @@ export default {
_this.initGzbgChart5();
_this.initGzbgChart6();
_this.initGzbgChart7();
window.parent.postMessage(document.body.scrollHeight, '*');
})();
};
window.addEventListener("resize", function (e) {
......
......@@ -345,16 +345,23 @@ export default {
};
},
mounted() {
window.parent.postMessage(document.body.scrollHeight, '*');
window.onresize = () => {
return (() => {
window.parent.postMessage(document.body.scrollHeight, '*');
})();
};
window.addEventListener("resize", function (e) {
window.parent.postMessage(document.body.scrollHeight, '*');
});
},
}
};
</script>
<style lang="scss" scoped>
.ecology {
width: 1300px;
// width: 1300px;
width: calc(100% - 40px);
margin: 0px auto;
padding: 20px;
// background: #666
......
......@@ -694,6 +694,12 @@ export default {
this.init_line_1();
this.init_bar_2();
this.init_bar_1();
window.parent.postMessage(document.body.scrollHeight, '*');
window.onresize = () => {
return (() => {
window.parent.postMessage(document.body.scrollHeight, '*');
})();
};
window.addEventListener("resize", function (e) {
window.parent.postMessage(document.body.scrollHeight, '*');
});
......@@ -1051,7 +1057,8 @@ export default {
<style lang='scss' scoped>
.epidemic {
// background: #666;
width: 1300px;
// width: 1300px;
width: calc(100% - 40px);
margin: 0px auto;
padding: 20px
}
......
......@@ -225,6 +225,13 @@ export default {
this.initCharts2();
this.initCharts3();
this.initCharts4();
window.parent.postMessage(document.body.scrollHeight, '*');
window.onresize = () => {
return (() => {
window.parent.postMessage(document.body.scrollHeight, '*');
})();
};
window.addEventListener("resize", function (e) {
window.parent.postMessage(document.body.scrollHeight, '*');
});
......
......@@ -163,6 +163,7 @@ export default {
let _this = this;
this.initChart1();
this.initChart2();
window.parent.postMessage(document.body.scrollHeight, '*');
window.addEventListener("resize", function (e) {
window.parent.postMessage(document.body.scrollHeight, '*');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment