feat: 添加query功能
This commit is contained in:
30
demo/src/index.ts
Normal file
30
demo/src/index.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user