فهرست منبع

🐛 fix(portal): 修复 PMS 在手机钉钉中跳转至 PC 端的问题

Zimo 4 روز پیش
والد
کامیت
015fce25b7
1فایلهای تغییر یافته به همراه18 افزوده شده و 3 حذف شده
  1. 18 3
      src/views/index.vue

+ 18 - 3
src/views/index.vue

@@ -1304,9 +1304,24 @@ const handlePortalAppClick = async (app: PortalApp) => {
   }
 
   if (app.key === "pms") {
-    protectedOpen(
-      `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}`,
-    );
+    const pmsDesktopUrl = `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}`;
+    const pmsMobileUrl = `https://aims.deepoil.cc/deepoil/#/pages/entry/index?username=${userStore.getUser.username}`;
+    const ua = window.navigator.userAgent;
+    const isDesktopDingTalk =
+      isDingTalkClient() &&
+      (ua.includes("Windows") || ua.includes("Macintosh"));
+
+    if (isDingTalkClient() && !isDesktopDingTalk) {
+      if (userStore.getUser.username && getAccessToken()) {
+        dd.biz.util.openLink({
+          url: pmsMobileUrl,
+        });
+      } else {
+        router.push({ path: "/login" });
+      }
+    } else {
+      protectedOpen(pmsDesktopUrl);
+    }
   }
 
   if (app.key === "zhonghang") {