浏览代码

IE浏览器的提示

yuedefeng 6 年之前
父节点
当前提交
ac6f86044b
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      src/dashoo.cn/frontend_web/src/pages/login.vue

+ 15 - 0
src/dashoo.cn/frontend_web/src/pages/login.vue

@@ -393,6 +393,17 @@
       },
       handleSelect (key, keyPath) {
         this.activeIndex = key
+      },
+      isChrome () {
+        //取得浏览器的userAgent字符串
+        let userAgent = navigator.userAgent
+
+        //判断是否Chrome浏览器
+        if (userAgent.indexOf("Chrome") > -1){
+          return true
+        } else {
+            return false
+        }
       }
     }
 
@@ -402,6 +413,10 @@
       return 'empty'
     }
     login() {
+      if ( !this.isChrome() ) {
+        this.$alert('请用谷歌浏览器、360浏览器(极速模式)等,Chrome内核浏览器打开本系统', '不支持的浏览器', {})
+        return false
+      }
       this.logging = true
       this.$refs.user.validate(async (valid) => {
         try {