From 01b0e4ca572603bd7fbf55374d451cce967babe0 Mon Sep 17 00:00:00 2001 From: zhult13 Date: Wed, 19 Oct 2022 10:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=9A=84api=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/frontend/src/pages/search/User/index.tsx | 4 ++-- zlt-web/src/main/frontend/src/services/system/api.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/zlt-web/src/main/frontend/src/pages/search/User/index.tsx b/zlt-web/src/main/frontend/src/pages/search/User/index.tsx index 5120bca2..c1d4d692 100644 --- a/zlt-web/src/main/frontend/src/pages/search/User/index.tsx +++ b/zlt-web/src/main/frontend/src/pages/search/User/index.tsx @@ -1,4 +1,4 @@ -import { user } from '@/services/system/api'; +import { userSearch } from '@/services/system/api'; import type { ProColumns } from '@ant-design/pro-components'; import { ProFormSelect, @@ -88,7 +88,7 @@ const TableList: React.FC = () => { rowKey="id" headerTitle="用户管理" - request={user} + request={userSearch} columns={columns} search={false} params={params} diff --git a/zlt-web/src/main/frontend/src/services/system/api.ts b/zlt-web/src/main/frontend/src/services/system/api.ts index b4d35262..bd7e7719 100644 --- a/zlt-web/src/main/frontend/src/services/system/api.ts +++ b/zlt-web/src/main/frontend/src/services/system/api.ts @@ -78,6 +78,15 @@ export async function importImage(formData: FormData) { return result; } +export async function userSearch(params?: { [key: string]: string | number }) { + const { current, pageSize, ...rest } = params ?? {}; + const result = await request>('/api-user/users/search', { + method: 'GET', + params: { page: current, limit: pageSize, ...rest }, + }); + return { data: result.data, total: result.count }; +} + export async function role() { const result = await request>('/api-user/roles', { method: 'GET',