outaozhen 3 years ago
parent
commit
543af9e472
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/pages/Permission/Role/components/PermTabs/index.tsx

+ 5 - 1
src/pages/Permission/Role/components/PermTabs/index.tsx

@@ -13,10 +13,14 @@ const PermTabs = ({
     frontPermission: rolesPermission
     frontPermission: rolesPermission
   }
   }
 }) => {
 }) => {
+  console.log(rolesPermission)
+
   const [state, setState] = useState({
   const [state, setState] = useState({
     frontPermission: [], // 前台权限
     frontPermission: [], // 前台权限
     backstagePermission: [] // 后台权限
     backstagePermission: [] // 后台权限
   })
   })
+  console.log(state.frontPermission)
+
   const { run: trySetRolePermission } = useRequest(
   const { run: trySetRolePermission } = useRequest(
     (params: API.SetRolePermissionParams) => setRolePermission(params),
     (params: API.SetRolePermissionParams) => setRolePermission(params),
     {
     {
@@ -54,7 +58,7 @@ const PermTabs = ({
     if (activeKey === '2') {
     if (activeKey === '2') {
       setState({
       setState({
         ...state,
         ...state,
-        frontPermission: rolesPermission?.toString()
+        frontPermission: [].concat(rolesPermission)
       })
       })
     }
     }
   }, [activeKey])
   }, [activeKey])