Bläddra i källkod

feat: 使用自定义hooks接管巡检列表、弹窗功能逻辑

lanjianrong 4 år sedan
förälder
incheckning
ac002de0fa
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      src/components/Authorization/index.tsx

+ 4 - 2
src/components/Authorization/index.tsx

@@ -1,4 +1,6 @@
-import { tenderStore, userStore } from '@/store/mobx'
+import { tenderStore } from '@/store/mobx'
+import history from '@/utils/history'
+import { storage } from '@/utils/util'
 import { observer } from 'mobx-react'
 import React, { useEffect } from 'react'
 interface Authorization {
@@ -23,7 +25,7 @@ const Authorization: React.FC<Authorization> = ({ type, auth, children }) => {
   // 获取mobx存储的权限
   const permission = tenderStore.permission[type]
 
-  if (permission[auth] === authPass || !!userStore.userInfo.isAdmin) {
+  if (permission[auth] === authPass) {
     return <>{children}</>
   }
   return null