Kaynağa Gözat

菜单跳转

ZaiZai 1 yıl önce
ebeveyn
işleme
3d694edb65
1 değiştirilmiş dosya ile 12 ekleme ve 10 silme
  1. 12 10
      src/layout/modules/MenuBar.vue

+ 12 - 10
src/layout/modules/MenuBar.vue

@@ -30,7 +30,7 @@ import MenuItem from './MenuItem.vue'
 import { getToken } from '~src/api/util/auth'
 import { getStoreValue } from '~uti/storage'
 import { getTenantDetail } from '~api/other'
-import { getObjValue } from 'js-fast-way'
+import { getObjValue, isUrl } from 'js-fast-way'
 import { useAppStore } from '~src/store'
 const props = defineProps({
     datas: {
@@ -71,16 +71,18 @@ watch(() => [
 
 
 const MenuClick = async (item) => {
-    if (item?.code === 'to-archives-url') {
+    if (isUrl(item?.path)) {
         let token = getToken(), domain = item?.path
-        const tenantId = getStoreValue('tenantId')
-        if (tenantId === '000000' || !tenantId) {
-            domain = item?.path
-        } else {
-            const { error, code, data } = await getTenantDetail(tenantId)
-            if (!error && code === 200) {
-                const url = getObjValue(data).domainUrl
-                domain = url ? url : item?.path
+        if (item?.code === 'to-archives-url') {
+            const tenantId = getStoreValue('tenantId')
+            if (tenantId === '000000' || !tenantId) {
+                domain = item?.path
+            } else {
+                const { error, code, data } = await getTenantDetail(tenantId)
+                if (!error && code === 200) {
+                    const url = getObjValue(data).domainUrl
+                    domain = url ? url : item?.path
+                }
             }
         }
         window.open(domain + '/#/auth?token=' + token, '_blank')