Skip to content

Commit 98836e9

Browse files
authored
Merge pull request #74 from guanweiwang/main
feat: 添加 oauth 认证
2 parents 06f9c45 + f5a1c92 commit 98836e9

35 files changed

+2607
-626
lines changed

.github/workflows/frontend-ci-cd.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Frontend CI/CD
33
on:
44
push:
55
tags:
6-
- "v[0-9]+.[0-9]+.[0-9]+*"
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
77
paths:
88
- 'ui/**'
99
- '.github/workflows/frontend-ci-cd.yml'
@@ -29,12 +29,12 @@ jobs:
2929
- name: Set up Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: '20'
32+
node-version: '20.19.0'
3333

3434
- name: Set up pnpm
3535
uses: pnpm/action-setup@v2
3636
with:
37-
version: 8
37+
version: 10.12.1
3838

3939
- name: Get version
4040
id: get_version
@@ -130,4 +130,4 @@ jobs:
130130
${{ env.REGISTRY }}/frontend:${{ needs.build.outputs.version }}
131131
${{ env.REGISTRY }}/frontend:latest
132132
cache-from: type=gha
133-
cache-to: type=gha,mode=max
133+
cache-to: type=gha,mode=max

ui/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
PLATFORM=linux/amd64
2+
TAG=main
3+
REGISTRY=monkeycode
4+
5+
6+
# 构建前端代码
7+
build:
8+
pnpm run build
9+
10+
# 构建并加载到本地Docker
11+
image: build
12+
docker buildx build \
13+
-f .Dockerfile \
14+
--platform ${PLATFORM} \
15+
--tag ${REGISTRY}/frontend:${TAG} \
16+
--load \
17+
.
18+
19+
save: image
20+
docker save -o /tmp/monkeycode_frontend.tar monkeycode/frontend:main
21+

ui/src/api/Admin.ts

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
/* eslint-disable */
2+
/* tslint:disable */
3+
// @ts-nocheck
4+
/*
5+
* ---------------------------------------------------------------
6+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7+
* ## ##
8+
* ## AUTHOR: acacode ##
9+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10+
* ---------------------------------------------------------------
11+
*/
12+
13+
import request, { ContentType, RequestParams } from "./httpClient";
14+
import {
15+
DeleteDeleteAdminParams,
16+
DomainAdminUser,
17+
DomainCreateAdminReq,
18+
DomainListAdminLoginHistoryResp,
19+
DomainListAdminUserResp,
20+
DomainLoginReq,
21+
DomainSetting,
22+
DomainUpdateSettingReq,
23+
GetAdminLoginHistoryParams,
24+
GetListAdminUserParams,
25+
WebResp,
26+
} from "./types";
27+
28+
/**
29+
* @description 创建管理员
30+
*
31+
* @tags Admin
32+
* @name PostCreateAdmin
33+
* @summary 创建管理员
34+
* @request POST:/api/v1/admin/create
35+
* @response `200` `(WebResp & {
36+
data?: DomainAdminUser,
37+
38+
})` OK
39+
*/
40+
41+
export const postCreateAdmin = (
42+
param: DomainCreateAdminReq,
43+
params: RequestParams = {},
44+
) =>
45+
request<
46+
WebResp & {
47+
data?: DomainAdminUser;
48+
}
49+
>({
50+
path: `/api/v1/admin/create`,
51+
method: "POST",
52+
body: param,
53+
type: ContentType.Json,
54+
format: "json",
55+
...params,
56+
});
57+
58+
/**
59+
* @description 删除管理员
60+
*
61+
* @tags Admin
62+
* @name DeleteDeleteAdmin
63+
* @summary 删除管理员
64+
* @request DELETE:/api/v1/admin/delete
65+
* @response `200` `(WebResp & {
66+
data?: Record<string, any>,
67+
68+
})` OK
69+
*/
70+
71+
export const deleteDeleteAdmin = (
72+
query: DeleteDeleteAdminParams,
73+
params: RequestParams = {},
74+
) =>
75+
request<
76+
WebResp & {
77+
data?: Record<string, any>;
78+
}
79+
>({
80+
path: `/api/v1/admin/delete`,
81+
method: "DELETE",
82+
query: query,
83+
type: ContentType.Json,
84+
format: "json",
85+
...params,
86+
});
87+
88+
/**
89+
* @description 获取管理员用户列表
90+
*
91+
* @tags Admin
92+
* @name GetListAdminUser
93+
* @summary 获取管理员用户列表
94+
* @request GET:/api/v1/admin/list
95+
* @response `200` `(WebResp & {
96+
data?: DomainListAdminUserResp,
97+
98+
})` OK
99+
*/
100+
101+
export const getListAdminUser = (
102+
query: GetListAdminUserParams,
103+
params: RequestParams = {},
104+
) =>
105+
request<
106+
WebResp & {
107+
data?: DomainListAdminUserResp;
108+
}
109+
>({
110+
path: `/api/v1/admin/list`,
111+
method: "GET",
112+
query: query,
113+
type: ContentType.Json,
114+
format: "json",
115+
...params,
116+
});
117+
118+
/**
119+
* @description 管理员登录
120+
*
121+
* @tags Admin
122+
* @name PostAdminLogin
123+
* @summary 管理员登录
124+
* @request POST:/api/v1/admin/login
125+
* @response `200` `(WebResp & {
126+
data?: DomainAdminUser,
127+
128+
})` OK
129+
*/
130+
131+
export const postAdminLogin = (
132+
param: DomainLoginReq,
133+
params: RequestParams = {},
134+
) =>
135+
request<
136+
WebResp & {
137+
data?: DomainAdminUser;
138+
}
139+
>({
140+
path: `/api/v1/admin/login`,
141+
method: "POST",
142+
body: param,
143+
type: ContentType.Json,
144+
format: "json",
145+
...params,
146+
});
147+
148+
/**
149+
* @description 获取管理员登录历史
150+
*
151+
* @tags Admin
152+
* @name GetAdminLoginHistory
153+
* @summary 获取管理员登录历史
154+
* @request GET:/api/v1/admin/login-history
155+
* @response `200` `(WebResp & {
156+
data?: DomainListAdminLoginHistoryResp,
157+
158+
})` OK
159+
*/
160+
161+
export const getAdminLoginHistory = (
162+
query: GetAdminLoginHistoryParams,
163+
params: RequestParams = {},
164+
) =>
165+
request<
166+
WebResp & {
167+
data?: DomainListAdminLoginHistoryResp;
168+
}
169+
>({
170+
path: `/api/v1/admin/login-history`,
171+
method: "GET",
172+
query: query,
173+
type: ContentType.Json,
174+
format: "json",
175+
...params,
176+
});
177+
178+
/**
179+
* @description 获取系统设置
180+
*
181+
* @tags Admin
182+
* @name GetGetSetting
183+
* @summary 获取系统设置
184+
* @request GET:/api/v1/admin/setting
185+
* @response `200` `(WebResp & {
186+
data?: DomainSetting,
187+
188+
})` OK
189+
*/
190+
191+
export const getGetSetting = (params: RequestParams = {}) =>
192+
request<
193+
WebResp & {
194+
data?: DomainSetting;
195+
}
196+
>({
197+
path: `/api/v1/admin/setting`,
198+
method: "GET",
199+
type: ContentType.Json,
200+
format: "json",
201+
...params,
202+
});
203+
204+
/**
205+
* @description 更新系统设置
206+
*
207+
* @tags Admin
208+
* @name PutUpdateSetting
209+
* @summary 更新系统设置
210+
* @request PUT:/api/v1/admin/setting
211+
* @response `200` `(WebResp & {
212+
data?: DomainSetting,
213+
214+
})` OK
215+
*/
216+
217+
export const putUpdateSetting = (
218+
param: DomainUpdateSettingReq,
219+
params: RequestParams = {},
220+
) =>
221+
request<
222+
WebResp & {
223+
data?: DomainSetting;
224+
}
225+
>({
226+
path: `/api/v1/admin/setting`,
227+
method: "PUT",
228+
body: param,
229+
type: ContentType.Json,
230+
format: "json",
231+
...params,
232+
});

0 commit comments

Comments
 (0)