feat: 初始化项目并完成基础功能开发
- 完成项目初始化
- 实现用户注册、登录功能
- 完成用户管理与权限管理模块
- 开发后端 Tracker 服务器项目管理接口
- 实现日志管理接口
Change-Id: Ia4bde1c9ff600352a7ff0caca0cc50b02cad1af7
diff --git a/react-ui/src/services/system/auth.ts b/react-ui/src/services/system/auth.ts
new file mode 100644
index 0000000..b757618
--- /dev/null
+++ b/react-ui/src/services/system/auth.ts
@@ -0,0 +1,39 @@
+import { request } from '@umijs/max';
+
+export async function getCaptchaImg(params?: Record<string, any>, options?: Record<string, any>) {
+ return request('/api/captchaImage', {
+ method: 'GET',
+ params: {
+ ...params,
+ },
+ headers: {
+ isToken: false,
+ },
+ ...(options || {}),
+ });
+}
+
+/** 登录接口 POST /api/login/account */
+export async function login(body: API.LoginParams, options?: Record<string, any>) {
+ return request<API.LoginResult>('/api/login', {
+ method: 'POST',
+ headers: {
+ isToken: false,
+ 'Content-Type': 'application/json',
+ },
+ data: body,
+ ...(options || {}),
+ });
+}
+
+/** 退出登录接口 POST /api/login/outLogin */
+export async function logout() {
+ return request<Record<string, any>>('/api/logout', {
+ method: 'delete',
+ });
+}
+
+// 获取手机验证码
+export async function getMobileCaptcha(mobile: string) {
+ return request(`/api/login/captcha?mobile=${mobile}`);
+}