diff --git a/src/pages/BlockUser/index.jsx b/src/pages/BlockUser/index.jsx index bd7670d..aeb0dfb 100644 --- a/src/pages/BlockUser/index.jsx +++ b/src/pages/BlockUser/index.jsx @@ -10,7 +10,6 @@ import { import baseRequest from "../../utils/baseRequest"; const BlockUserContent = (props) => { - const { TextArea } = Input; const current = props.current; //表头 const columns = [ @@ -137,7 +136,7 @@ const BlockUserContent = (props) => { //获取数据 const [data, setData] = useState([]); - const getData = async () => { + const getData = async (user_id) => { let querryUrl; switch (current) { case "blocking": @@ -158,7 +157,8 @@ const BlockUserContent = (props) => { }, body: JSON.stringify({ offset: 0, - limit: 10000, + limit: 100, + user_id: user_id ? parseInt(user_id, 10) : undefined, ...base, }), }); @@ -197,7 +197,7 @@ const BlockUserContent = (props) => { ut: new Date(item.account_punishments.ut * 1000).toLocaleString(), }; }); - setData([...data, ...structedData]); + setData([...structedData]); } catch (error) { console.error(error); } @@ -214,9 +214,7 @@ const BlockUserContent = (props) => { //搜索用户 const search = (value) => { - value.id - ? setShowData(data.filter((item) => item.user.user_id == value.id)) - : setShowData(data); + getData(value.id); }; //打开添加封禁Modal @@ -323,6 +321,7 @@ const BlockUserContent = (props) => { > 添加封禁 +
仅显示最新100条