Bläddra i källkod

feat: 菜单栏左下角当没有用户名是显示账号。

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

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

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