feat: 添加query功能

This commit is contained in:
2024-09-08 04:32:41 +08:00
parent 443a41110a
commit 360f6ba180
24 changed files with 6228 additions and 48 deletions

30
demo/src/index.ts Normal file
View File

@@ -0,0 +1,30 @@
// console.log('Hello World');
import { adapter, Query } from '@abearxiong/query';
window.onload = async () => {
// const res = await adapter({
// url: '/api/router',
// body: {
// path: 'demo',
// key: '1',
// },
// });
// console.log(res);
const query = new Query({ url: '/api/router' });
// const res = await query.post(
// {
// path: 'demo',
// key: '1',
// },
// );
const res = await query.post(
{
path: 'demo',
key: '3',
},
{
timeout: 5000,
},
);
console.log(res);
};