Przeglądaj źródła

crm单点处理

yanghao 2 dni temu
rodzic
commit
034a29e6e2
3 zmienionych plików z 50 dodań i 19 usunięć
  1. 32 14
      src/views/flow/crmTodoList.vue
  2. 10 4
      src/views/flow/index.vue
  3. 8 1
      src/views/index.vue

+ 32 - 14
src/views/flow/crmTodoList.vue

@@ -340,20 +340,38 @@ const handleSizeChange = async (size) => {
 
 const goBackPage = async (row) => {
   if (userStore.getUser.username && getAccessToken()) {
-    const ua = window.navigator.userAgent.toLowerCase();
-    if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
-      dd.biz.util.openLink({
-        url: `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
-
-        onSuccess: () => {
-          // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
-          setTimeout(() => {
-            dd.biz.util.openLink({
-              url: `https://crm-tencent.xiaoshouyi.com/bff/neoweb#/approval_workbench`,
-            });
-          }, 3000);
-        },
-      });
+    const ua = window.navigator.userAgent; // const ua = navigator.userAgent;
+    const isDesktop =
+      ua.includes("DingTalk") &&
+      (ua.includes("Windows") || ua.includes("Macintosh"));
+
+    let ua2 = navigator.userAgent.toLowerCase();
+    var isMobile = ua2.indexOf("dingtalk") > -1;
+    if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
+      if (isMobile && !isDesktop) {
+        const originPath =
+          "/bff/spa/crmh5/index.html#/home?platform=H5&deviceType=0";
+        // 连续三次encodeURIComponent
+        let e1 = encodeURIComponent(originPath);
+        let e2 = encodeURIComponent(e1);
+        let e3 = encodeURIComponent(e2);
+        dd.biz.util.openLink({
+          url: `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}&returnUri=${e3}`,
+
+          onSuccess: () => {},
+        });
+      } else if (isDesktop) {
+        dd.biz.util.openLink({
+          url: `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
+          onSuccess: () => {
+            setTimeout(() => {
+              dd.biz.util.openLink({
+                url: `https://crm-tencent.xiaoshouyi.com/bff/neoweb#/approval_workbench`,
+              });
+            }, 3000);
+          },
+        });
+      }
     } else {
       const newTab = window.open("", "_blank");
       newTab.location.href = `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`;

+ 10 - 4
src/views/flow/index.vue

@@ -499,9 +499,15 @@ const go = async (item) => {
     }
 
     if (item.type === "CRM") {
-      const ua = window.navigator.userAgent.toLowerCase();
-      if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
-        if (window.dd) {
+      const ua = window.navigator.userAgent; // const ua = navigator.userAgent;
+      const isDesktop =
+        ua.includes("DingTalk") &&
+        (ua.includes("Windows") || ua.includes("Macintosh"));
+
+      let ua2 = navigator.userAgent.toLowerCase();
+      var isMobile = ua2.indexOf("dingtalk") > -1;
+      if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
+        if (isMobile && !isDesktop) {
           const newTab = window.open("", "_blank");
           newTab.location.href =
             item.indexUrl +
@@ -511,7 +517,7 @@ const go = async (item) => {
           setTimeout(function () {
             newTab.location.href = item.flowUrl;
           }, 3000);
-        } else if (window.DingTalkPC) {
+        } else if (isDesktop) {
           const newTab = window.open("", "_blank");
           newTab.location.href =
             item.indexUrl +

+ 8 - 1
src/views/index.vue

@@ -990,8 +990,15 @@ const handlePortalAppClick = async (app: PortalApp) => {
       var isMobile = ua2.indexOf("dingtalk") > -1;
       if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
         if (isMobile && !isDesktop) {
+          const originPath =
+            "/bff/spa/crmh5/index.html#/home?platform=H5&deviceType=0";
+          // 连续三次encodeURIComponent
+          let e1 = encodeURIComponent(originPath);
+          let e2 = encodeURIComponent(e1);
+          let e3 = encodeURIComponent(e2);
+
           dd.biz.util.openLink({
-            url: `https://crm-tencent.xiaoshouyi.com/bff/spa/crmh5/index.html#/neo/startPage?token=${getAccessToken()}`,
+            url: `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}&returnUri=${e3}`,
 
             onSuccess: () => {},
           });