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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
| // @ts-ignore
| /* eslint-disable */
| import { request } from '@umijs/max';
|
| /** 获取当前的用户 GET /api/currentUser */
| export async function currentUser(options?: { [key: string]: any }) {
| return request<{
| data: API.CurrentUser;
| }>('/api/currentUser', {
| method: 'GET',
| ...(options || {}),
| });
| }
|
| /** 退出登录接口 POST /api/login/outLogin */
| export async function outLogin(options?: { [key: string]: any }) {
| return request<Record<string, any>>('/api/login/outLogin', {
| method: 'POST',
| ...(options || {}),
| });
| }
|
| /** 登录接口 POST /api/login/account */
| export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
| return request<API.LoginResult>('/api/login/account', {
| method: 'POST',
| headers: {
| 'Content-Type': 'application/json',
| },
| data: body,
| ...(options || {}),
| });
| }
|
| /** 此处后端没有提供注释 GET /api/notices */
| export async function getNotices(options?: { [key: string]: any }) {
| return request<API.NoticeIconList>('/api/notices', {
| method: 'GET',
| ...(options || {}),
| });
| }
|
| /** 获取规则列表 GET /api/rule */
| export async function rule(
| params: {
| // query
| /** 当前的页码 */
| current?: number;
| /** 页面的容量 */
| pageSize?: number;
| },
| options?: { [key: string]: any },
| ) {
| return request<API.RuleList>('/api/rule', {
| method: 'GET',
| params: {
| ...params,
| },
| ...(options || {}),
| });
| }
|
| /** 更新规则 PUT /api/rule */
| export async function updateRule(options?: { [key: string]: any }) {
| return request<API.RuleListItem>('/api/rule', {
| method: 'POST',
| data:{
| method: 'update',
| ...(options || {}),
| }
| });
| }
|
| /** 新建规则 POST /api/rule */
| export async function addRule(options?: { [key: string]: any }) {
| return request<API.RuleListItem>('/api/rule', {
| method: 'POST',
| data:{
| method: 'post',
| ...(options || {}),
| }
| });
| }
|
| /** 删除规则 DELETE /api/rule */
| export async function removeRule(options?: { [key: string]: any }) {
| return request<Record<string, any>>('/api/rule', {
| method: 'POST',
| data:{
| method: 'delete',
| ...(options || {}),
| }
| });
| }
|
|