-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathqrcode.ts
54 lines (45 loc) · 1.16 KB
/
qrcode.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// 扫码创建
import {get, post} from "./index";
// 扫码创建
export interface QRCodeCreateRequest {
device_seed: number;
protocol: number;
}
export interface QRCodeCreateResponse {
sig: string;
image: string;
}
// 查询状态
export interface QRCodeQueryRequest {
sig: string;
}
export interface QRCodeQueryResponse {
state: string;
}
// 删除
export interface QRCodeDeleteRequest {
sig: string;
}
export interface BaseResponse {
}
export interface QRCodeListResponse {
clients: QRCodeClient[];
}
export interface QRCodeClient {
sig: string;
image: string;
protocol: number;
state: string;
}
export const qrcodeCreate = async (req: QRCodeCreateRequest): Promise<QRCodeCreateResponse> => {
return await post("/login/qrcode/create", req)
}
export const qrcodeQuery = async (req: QRCodeQueryRequest): Promise<QRCodeQueryResponse> => {
return await post("/login/qrcode/query", req)
}
export const qrcodeDelete = async (req: QRCodeDeleteRequest): Promise<BaseResponse> => {
return await post("/login/qrcode/delete", req)
}
export const qrcodeListClient = async (): Promise<QRCodeListResponse> => {
return await get("/login/qrcode/list")
}