ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1.新建list.ts ``` import { Request, Response } from 'express'; import { waitTime } from '../src/utils/utils'; const getList = async (req: Request, res: Response) => { await waitTime(2000); const result = { success: true, data: [       { id: 1, name: 'admn',       },       { id: 2, name: 'test',       },     ],   }; return res.json(result); }; export default { 'Get /api/getList': getList, }; ``` 2.创建services ``` import { request } from 'umi'; export async function getList() { return request('/api/getList'); } ``` 3.创建list.tsx ``` import React from 'react'; import ProTable from '@ant-design/pro-table'; import type { ProColumns } from '@ant-design/pro-table'; import { getList } from '@/services/list'; const NoFoundPage: React.FC = () => { const columns: ProColumns[] = [     { title: 'Id', dataIndex: 'id',     },     { title: 'Name', dataIndex: 'name',     },   ]; return ( <> <ProTable columns={columns} request={async (params) => { const reslut = await getList(); return reslut;         }} </>   ); }; export default NoFoundPage; ```