2
3
yuedefeng 6 лет назад
Родитель
Сommit
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 {