lanjianrong 4 лет назад
Родитель
Сommit
328fe52c72
2 измененных файлов с 3 добавлено и 24 удалено
  1. 3 1
      src/access.ts
  2. 0 23
      src/utils/utils.js

+ 3 - 1
src/access.ts

@@ -9,6 +9,8 @@ export default function (initialState) {
       return true
     }
     const name = route.path?.match(/\/(\w*)\//)?.[1]
+    console.log(route)
+
     if (name && permData[name] && permData[name]?.length) {
       return true
     }
@@ -29,7 +31,7 @@ export default function (initialState) {
   }
 
   /** 协作标签 */
-  const canEditTag = (type: 0 | 1): boolean => {
+  const canEditTag = (type: TagDataType): boolean => {
     if (type === TagDataType.CLIENT) return roles.includes('client_edit_team_tags')
     if (type === TagDataType.COMPANY) return roles.includes('company_edit_team_tags')
     return false

+ 0 - 23
src/utils/utils.js

@@ -1,28 +1,5 @@
-import { parse } from 'querystring'
 import dayjs from 'dayjs'
 
-const reg =
-  /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/
-export const isUrl = path => reg.test(path)
-export const isAntDesignPro = () => {
-  if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
-    return true
-  }
-
-  return window.location.hostname === 'preview.pro.ant.design'
-} // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
-
-export const isAntDesignProOrDev = () => {
-  const { NODE_ENV } = process.env
-
-  if (NODE_ENV === 'development') {
-    return true
-  }
-
-  return isAntDesignPro()
-}
-export const getPageQuery = () => parse(window.location.href.split('?')[1])
-
 /**
  * 日期格式化
  * @param format - 格式