Commit 2f1d461b by 弓厶

修改登录页的浏览器提示

parent 9c7128b9
...@@ -125,6 +125,7 @@ export default { ...@@ -125,6 +125,7 @@ export default {
created() { created() {
Vue.ls.remove(ACCESS_TOKEN) Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData(); this.getRouterData();
this.browserTips();
}, },
methods: { methods: {
...mapActions(["Login", "Logout"]), ...mapActions(["Login", "Logout"]),
...@@ -289,6 +290,54 @@ export default { ...@@ -289,6 +290,54 @@ export default {
}); });
}) })
}, },
// 提示浏览器版本
browserTips() {
//取得浏览器的userAgent字符串
let userAgent = navigator.userAgent;
try {
//判断是否IE<11浏览器
let isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1;
//判断是否IE的Edge浏览器
let isEdge = userAgent.indexOf("Edge") > -1 && !isIE;
let isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if (isIE) {
let reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
let fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion == 7) {
this.$notification.error({
message: "系统不兼容 IE 7 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
} else if (fIEVersion == 8) {
this.$notification.error({
message: "系统不兼容 IE 8 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
} else if (fIEVersion == 9) {
this.$notification.error({
message: "系统不兼容 IE 9 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
} else if (fIEVersion == 10) {
this.$notification.error({
message: "系统不兼容 IE 10 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
} else {
this.$notification.error({
message: "系统不兼容 IE 6及其以下版本浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
}
} else if (isEdge) {
this.$notification.error({
message: "系统不兼容 IE Edge 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
} else if (isIE11) {
this.$notification.error({
message: "系统不兼容 IE 11 浏览器,推荐使用Chrome。请到https://www.google.cn/chrome 下载。如果使用双核浏览器请切换极速模式!"
});
}
} finally {
console.log(userAgent);
}
}
} }
} }
</script> </script>
......
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