-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
console.log("从零开发!") | ||
import { que } from "./fetch.ts" | ||
|
||
console.log("从零开发!") | ||
|
||
const adm = await que({ que: "adm" }) | ||
|
||
console.log(adm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { Que, QueRet } from "../../src/pra/que.ts" | ||
import { json_s } from "../../src/ont/json.ts" | ||
|
||
// 服务:端口 | ||
const ser = `http://localhost:728` | ||
|
||
// 绑定数据(浏览器端)<->(服务器端) | ||
|
||
// 查询接口 | ||
export async function que< | ||
T extends QueRet[Que["que"]] | ||
>( | ||
q: Que | ||
) { | ||
const s = json_s(q) | ||
const r = (await fetch(`${ser}/q?${s}`)).json() // HTTP GET 请求 | ||
console.log(`GET ${s}`) | ||
return r as unknown as T | ||
} | ||
|
||
// 请求接口 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters