yanghao 14 годин тому
батько
коміт
89b68c3e8a
2 змінених файлів з 36 додано та 3 видалено
  1. 34 1
      src/views/index.vue
  2. 2 2
      src/views/login.vue

+ 34 - 1
src/views/index.vue

@@ -233,7 +233,10 @@
               v-if="section.apps?.length"
               class="grid grid-cols-[repeat(2,minmax(0,1fr))] gap-2 p-6 px-3 md:px-4 md:grid-cols-[repeat(3,minmax(0,1fr))] xl:grid-cols-[repeat(3,minmax(0,1fr))]"
             >
-              <template v-for="(app, appIndex) in section.apps" :key="`${section.code}-${appIndex}-${app.label}`">
+              <template
+                v-for="(app, appIndex) in section.apps"
+                :key="`${section.code}-${appIndex}-${app.label}`"
+              >
                 <button
                   v-if="app.key === 'fm'"
                   v-hasPermi="['portal:financial:view']"
@@ -1423,6 +1426,36 @@ const handlePortalAppClick = async (app: PortalApp) => {
       router.push({ path: "/login" });
     }
   }
+
+  if (app.key === "fm") {
+    const ua = window.navigator.userAgent;
+    const isDesktop =
+      ua.includes("DingTalk") &&
+      (ua.includes("Windows") || ua.includes("Macintosh"));
+
+    let ua2 = navigator.userAgent.toLowerCase();
+    let isMobile = ua2.indexOf("dingtalk") > -1;
+    const res = await getMCSsoToken();
+    if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
+      if (isMobile && !isDesktop) {
+        dd.biz.util.openLink({
+          url: `${"https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1"}&ssoToken=${res}`,
+          onSuccess: () => {},
+        });
+      } else if (isDesktop) {
+        window.open(
+          `${"https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1"}&ssoToken=${res}`,
+          "_blank",
+        );
+      }
+    } else {
+      // 浏览器环境
+      window.open(
+        `${"https://report.deepoil.cc/webroot/decision/v10/entry/access/e836fb5b-092c-4d64-a324-3beeb4fac0cc?preview=true&page_number=1"}&ssoToken=${res}`,
+        "_blank",
+      );
+    }
+  }
 };
 
 async function loginWithDingTalk() {

+ 2 - 2
src/views/login.vue

@@ -23,7 +23,7 @@
         </h1>
 
         <!-- 用户名密码登陆 -->
-        <div>
+        <!-- <div>
           <el-form
             :model="form"
             :rules="rules"
@@ -64,7 +64,7 @@
               >
             </div>
           </div>
-        </div>
+        </div> -->
 
         <!-- 钉钉登陆 -->
         <div class="text-center">