Explorar o código

crm跳转时间调整

yanghao hai 3 días
pai
achega
296d7bf3bc
Modificáronse 2 ficheiros con 29 adicións e 19 borrados
  1. 3 8
      src/views/flow/crmTodoList.vue
  2. 26 11
      src/views/flow/index.vue

+ 3 - 8
src/views/flow/crmTodoList.vue

@@ -351,24 +351,19 @@ const goBackPage = async (row) => {
             dd.biz.util.openLink({
               url: `https://crm-tencent.xiaoshouyi.com/bff/neoweb#/approval_workbench`,
             });
-          }, 100);
+          }, 3000);
         },
       });
     } else {
-      const loading = ElLoading.service({
-        lock: true,
-        text: "正在跳转,请稍候...",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
       const newTab = window.open("", "_blank");
       newTab.location.href = `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`;
 
       setTimeout(function () {
         newTab.location.href = `https://crm-tencent.xiaoshouyi.com/bff/neoweb#/approval_workbench`;
         setTimeout(() => {
-          loading.close();
+          // loading.close();
         }, 500);
-      }, 100);
+      }, 3000);
     }
   } else {
     router.push("/login");

+ 26 - 11
src/views/flow/index.vue

@@ -501,19 +501,34 @@ const go = async (item) => {
     if (item.type === "CRM") {
       const ua = window.navigator.userAgent.toLowerCase();
       if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
-        dd.biz.util.openLink({
-          url:
+        if (window.dd) {
+          const targetUrl = item.appUrl;
+          if (targetUrl) {
+            dd.biz.util.openLink({
+              url: targetUrl,
+
+              onSuccess: () => {},
+            });
+          } else {
+            dd.biz.util.openLink({
+              url: "https://crm-tencent.xiaoshouyi.com",
+
+              onSuccess: () => {},
+            });
+          }
+        } else if (window.DingTalkPC) {
+          const newTab = window.open("", "_blank");
+          newTab.location.href =
             item.indexUrl +
             "/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=" +
-            getAccessToken(), // 先跳你的 SSO 链接
-          onSuccess: () => {
-            // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
-            setTimeout(() => {
-              dd.biz.util.openLink({ url: item.flowUrl });
-            }, 100);
-          },
-        });
+            getAccessToken();
+
+          setTimeout(function () {
+            newTab.location.href = item.flowUrl;
+          }, 3000);
+        }
       } else {
+        // 浏览器环境
         const newTab = window.open("", "_blank");
         newTab.location.href =
           item.indexUrl +
@@ -522,7 +537,7 @@ const go = async (item) => {
 
         setTimeout(function () {
           newTab.location.href = item.flowUrl;
-        }, 100);
+        }, 3000);
       }
     }
   } else {