Browse Source

菜单跳转

ZaiZai 1 year ago
parent
commit
1e18e45005
3 changed files with 11 additions and 21 deletions
  1. 1 1
      public/version.json
  2. 4 2
      src/layout/modules/MenuBar.vue
  3. 6 18
      src/utils/tools.js

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20230913180852"
+  "value": "20230926172836"
 }

+ 4 - 2
src/layout/modules/MenuBar.vue

@@ -30,8 +30,10 @@ import MenuItem from './MenuItem.vue'
 import { getToken } from '~src/api/util/auth'
 import { getStoreValue } from '~uti/storage'
 import { getTenantDetail } from '~api/other'
-import { getObjValue, isUrl } from 'js-fast-way'
+import { getObjValue } from 'js-fast-way'
 import { useAppStore } from '~src/store'
+import { isPathUrl } from '~uti/tools'
+
 const props = defineProps({
     datas: {
         type: Array,
@@ -71,7 +73,7 @@ watch(() => [
 
 
 const MenuClick = async (item) => {
-    if (isUrl(item?.path)) {
+    if (isPathUrl(item?.path)) {
         let token = getToken(), domain = item?.path
         if (item?.code === 'to-archives-url') {
             const tenantId = getStoreValue('tenantId')

+ 6 - 18
src/utils/tools.js

@@ -1,21 +1,4 @@
-import { arrIndex, clog } from 'js-fast-way'
-import config from '~src/config/index'
-
-import { useAppStore } from '~src/store'
-
-const store = useAppStore()
-
-//控制台打印
-export const HcLog = (name, tips, data) => {
-    const title = store.barMenuName ?? ''
-    if (config.isLog === 'auto') {
-        if (import.meta.env.DEV) {
-            clog(title, name, tips, data)
-        }
-    } else if (config.isLog === true) {
-        clog(title, name, tips, data)
-    }
-}
+import { arrIndex } from 'js-fast-way'
 
 //取数组中的值
 export const getRowsValue = (arr, key, key2, value) => {
@@ -78,3 +61,8 @@ export const setAppName = (name) => {
     const title = window.document.title
     window.document.title = `${title}${name ? ' - ' + name : ''}`
 }
+
+//判断是否为网址
+export const isPathUrl = (path) => {
+    return /^(https?:|mailto:|tel:)/.test(path)
+}