Browse Source

调整鸿盘位置

yanghao 2 weeks ago
parent
commit
6e63fd2828
1 changed files with 14 additions and 4 deletions
  1. 14 4
      src/views/index.vue

+ 14 - 4
src/views/index.vue

@@ -1053,6 +1053,9 @@ const protectedOpen = (url: string) => {
 
 let dialogVisible = ref(false);
 
+let ua2 = navigator.userAgent.toLowerCase();
+let isDing = ua2.includes("dingtalk") || ua2.includes("dingtalkwork");
+
 const handlePortalAppClick = async (app: PortalApp) => {
   if (!app.label) return;
 
@@ -1306,11 +1309,18 @@ const handlePortalAppClick = async (app: PortalApp) => {
 
   if (app.label === "绩效管理(OKR)") {
     if (userStore.getUser.username && getAccessToken()) {
-      dd.biz.util.openLink({
-        url: `https://dingokr.eapps.dingtalkcloud.com/web/index.html?corpId=dingbe7f9a7e8cffa2bd35c2f4657eb6378f`,
+      if (isDing) {
+        dd.biz.util.openLink({
+          url: `https://dingokr.eapps.dingtalkcloud.com/web/index.html?corpId=dingbe7f9a7e8cffa2bd35c2f4657eb6378f`,
 
-        onSuccess: () => {},
-      });
+          onSuccess: () => {},
+        });
+      } else {
+        window.open(
+          `https://dingokr.eapps.dingtalkcloud.com/web/index.html?corpId=dingbe7f9a7e8cffa2bd35c2f4657eb6378f`,
+          "_blank",
+        );
+      }
     } else {
       router.push({ path: "/login" });
     }