feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -51,6 +51,7 @@ export const useRiskControlData = (active = true) => {
|
||||
const [banLogLoading, setBanLogLoading] = useState(false);
|
||||
const [banLogStatus, setBanLogStatus] = useState(0); // 0=全部 1=已封号 2=已解封
|
||||
const [banLogPage, setBanLogPage] = useState(1);
|
||||
const [banLogPageSize, setBanLogPageSize] = useState(20);
|
||||
|
||||
const fetchSuspects = useCallback(
|
||||
async (override) => {
|
||||
@@ -144,7 +145,9 @@ export const useRiskControlData = (active = true) => {
|
||||
const params = new URLSearchParams();
|
||||
if (status > 0) params.append('status', status);
|
||||
params.append('page', page);
|
||||
params.append('page_size', 20);
|
||||
const size = override?.pageSize || banLogPageSize;
|
||||
params.append('page_size', size);
|
||||
setBanLogPageSize(size);
|
||||
setBanLogLoading(true);
|
||||
try {
|
||||
const res = await API.get(
|
||||
@@ -155,14 +158,16 @@ export const useRiskControlData = (active = true) => {
|
||||
setBanLogs(d.items || []);
|
||||
setBanLogTotal(d.total || 0);
|
||||
if (override?.page) setBanLogPage(override.page);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('查询封号日志失败', e);
|
||||
showError(e.message);
|
||||
} finally {
|
||||
setBanLogLoading(false);
|
||||
}
|
||||
},
|
||||
[banLogStatus, banLogPage],
|
||||
[banLogStatus, banLogPage, banLogPageSize],
|
||||
);
|
||||
|
||||
const unbanUser = useCallback(
|
||||
@@ -221,6 +226,7 @@ export const useRiskControlData = (active = true) => {
|
||||
banLogStatus,
|
||||
setBanLogStatus,
|
||||
banLogPage,
|
||||
banLogPageSize,
|
||||
fetchBanLogs,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user