fix: fix adapter

This commit is contained in:
2025-06-03 21:12:33 +08:00
parent 27adb05c39
commit 452f821d06
3 changed files with 24 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
# query
应的 fetch 内容的一部分功能的封装。
对 fetch 功能的的一部分功能的封装。主要处理header的token的提交和response中的处理json。
主要目的:请求路径默认`/api/router`,使用`post`,`post`的数据分流使用`path``key`.
@@ -8,7 +8,6 @@
## query
```ts
const query = new Query();
const res = await query.post({
@@ -35,4 +34,21 @@ type Data = {
type DataOpts = Partial<QueryOpts> & {
beforeRequest?: Fn;
};
```
```
## 适配的@kevisual/router的代码
```ts
import { App } from '@kevisual/router';
const app = new App();
app
.route({
path: 'demo',
key: '1',
})
.define(async (ctx) => {
ctx.body = 234;
})
.addTo(app);
```