修改用户搜索的api地址

This commit is contained in:
zhult13
2022-10-19 10:01:33 +08:00
parent fcccb31717
commit 01b0e4ca57
2 changed files with 11 additions and 2 deletions
@@ -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 = () => {
<ProTable<SYSTEM.User>
rowKey="id"
headerTitle="用户管理"
request={user}
request={userSearch}
columns={columns}
search={false}
params={params}
@@ -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<SYSTEM.Page<SYSTEM.User>>('/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<SYSTEM.Page<SYSTEM.Role>>('/api-user/roles', {
method: 'GET',