yanghao 1 долоо хоног өмнө
parent
commit
f104322c8d
2 өөрчлөгдсөн 19 нэмэгдсэн , 17 устгасан
  1. 17 15
      src/views/index.vue
  2. 2 2
      src/views/login.vue

+ 17 - 15
src/views/index.vue

@@ -165,7 +165,7 @@ async function loginWithDingTalk() {
 
       axios
         .post(
-          "https://portal.deepoil.cc/admin-api/system/auth/h5SocialLogin",
+          import.meta.env.BASE_URL + "/admin-api/system/auth/h5SocialLogin",
           {
             code: code,
             type: 20,
@@ -198,17 +198,16 @@ async function loginWithDingTalk() {
 }
 
 function dingTalkAutoLogin() {
-  // const ua = window.navigator.userAgent.toLowerCase();
+  const ua = window.navigator.userAgent.toLowerCase();
 
-  // console.log("ua :>> ", ua);
+  console.log("ua>>>>>>>>>>>>>>>>>>>>>>> ", ua);
 
-  // if (!ua.includes("dingtalk") && !ua.includes("dingtalkwork")) return;
-
-  loginWithDingTalk();
+  if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
+    loginWithDingTalk();
+  }
 }
 
 const unreadCount = ref(0); // 未读消息数量
-const list = ref<any[]>([]); // 消息列表
 // 获得未读消息数
 const getUnreadCount = async () => {
   getUnreadNotifyMessageCount().then((data) => {
@@ -222,14 +221,17 @@ onMounted(() => {
   // 首次加载小红点
   // getUnreadCount();
   // 轮询刷新小红点
-  setInterval(() => {
-    if (userStore.getIsSetUser) {
-      console.log("轮询刷新小红点");
-      getUnreadCount();
-    } else {
-      unreadCount.value = 0;
-    }
-  }, 1000);
+  setInterval(
+    () => {
+      if (userStore.getIsSetUser) {
+        console.log("轮询刷新小红点");
+        getUnreadCount();
+      } else {
+        unreadCount.value = 0;
+      }
+    },
+    1000 * 60 * 1,
+  );
 });
 </script>
 

+ 2 - 2
src/views/login.vue

@@ -21,7 +21,7 @@
         <h1 class="text-2xl font-bold text-center">登录</h1>
 
         <!-- 用户名密码登陆 -->
-        <div>
+        <!-- <div>
           <el-form
             :model="form"
             :rules="rules"
@@ -62,7 +62,7 @@
               >
             </div>
           </div>
-        </div>
+        </div> -->
 
         <!-- 钉钉登陆 -->
         <div class="text-center">