diff --git a/src/components/SystemSetting/UserPage.tsx b/src/components/SystemSetting/UserPage.tsx index 21313b7..24bf103 100644 --- a/src/components/SystemSetting/UserPage.tsx +++ b/src/components/SystemSetting/UserPage.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect } from 'react'; import { Layout, Tabs, Card, Row, Col, Button, Typography, Space, Modal, Form, Tree, message, Input, Popconfirm, Divider, InputNumber, Pagination, Table, Select, @@ -130,12 +130,13 @@ export default function UserRolePage() { const params = { pageNum: userPagination.pageNum, pageSize: userPagination.pageSize, - orgId: userInfo?.roleKey == "manager" ? userInfo?.orgId : currentStation?.orgId, - ...(userInfo?.roleKey == "manager" + orgId: userInfo?.roleKey === "manager" ? userInfo?.orgId : currentStation?.orgId, + ...(userInfo?.roleKey === "admin" && stationId ? {} : { siteId: stationId } ) }; + console.log(userInfo?.roleKey) getUser(params).then(res => { if (res.code === 200) { @@ -171,7 +172,7 @@ export default function UserRolePage() { useEffect(() => { getUserData(); getRoleForSelect(); - }, [userPagination.pageNum, userPagination.pageSize,]); + }, [userPagination.pageNum, userPagination.pageSize, stationId]); // ====================== 角色操作 ====================== const handleAddRole = () => {