feat: 初始化项目并完成基础功能开发
- 完成项目初始化
- 实现用户注册、登录功能
- 完成用户管理与权限管理模块
- 开发后端 Tracker 服务器项目管理接口
- 实现日志管理接口
Change-Id: Ia4bde1c9ff600352a7ff0caca0cc50b02cad1af7
diff --git a/react-ui/src/services/ant-design-pro/api.ts b/react-ui/src/services/ant-design-pro/api.ts
new file mode 100644
index 0000000..64a950a
--- /dev/null
+++ b/react-ui/src/services/ant-design-pro/api.ts
@@ -0,0 +1,11 @@
+// @ts-ignore
+/* eslint-disable */
+import { request } from '@umijs/max';
+
+/** 此处后端没有提供注释 GET /api/notices */
+export async function getNotices(options?: { [key: string]: any }) {
+ return request<API.NoticeIconList>('/api/notices', {
+ method: 'GET',
+ ...(options || {}),
+ });
+}
diff --git a/react-ui/src/services/ant-design-pro/index.ts b/react-ui/src/services/ant-design-pro/index.ts
new file mode 100644
index 0000000..9ae58be
--- /dev/null
+++ b/react-ui/src/services/ant-design-pro/index.ts
@@ -0,0 +1,12 @@
+// @ts-ignore
+/* eslint-disable */
+// API 更新时间:
+// API 唯一标识:
+import * as api from './api';
+import * as login from './login';
+import * as rule from './rule';
+export default {
+ api,
+ login,
+ rule,
+};
diff --git a/react-ui/src/services/ant-design-pro/login.ts b/react-ui/src/services/ant-design-pro/login.ts
new file mode 100644
index 0000000..3b00b43
--- /dev/null
+++ b/react-ui/src/services/ant-design-pro/login.ts
@@ -0,0 +1,38 @@
+// @ts-ignore
+/* eslint-disable */
+import { request } from '@umijs/max';
+
+/** 登录接口 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 || {}),
+ });
+}
+
+/** 发送验证码 POST /api/login/captcha */
+export async function getFakeCaptcha(
+ // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+ params: API.getFakeCaptchaParams,
+ options?: { [key: string]: any },
+) {
+ return request<API.FakeCaptcha>('/api/login/captcha', {
+ method: 'POST',
+ params: {
+ ...params,
+ },
+ ...(options || {}),
+ });
+}
+
+/** 登录接口 POST /api/login/outLogin */
+export async function outLogin(options?: { [key: string]: any }) {
+ return request<Record<string, any>>('/api/login/outLogin', {
+ method: 'POST',
+ ...(options || {}),
+ });
+}
diff --git a/react-ui/src/services/ant-design-pro/rule.ts b/react-ui/src/services/ant-design-pro/rule.ts
new file mode 100644
index 0000000..4b8ebc5
--- /dev/null
+++ b/react-ui/src/services/ant-design-pro/rule.ts
@@ -0,0 +1,42 @@
+// @ts-ignore
+/* eslint-disable */
+import { request } from '@umijs/max';
+
+/** 获取规则列表 GET /api/rule */
+export async function rule(
+ // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+ params: API.ruleParams,
+ 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: 'PUT',
+ ...(options || {}),
+ });
+}
+
+/** 新建规则 POST /api/rule */
+export async function addRule(options?: { [key: string]: any }) {
+ return request<API.RuleListItem>('/api/rule', {
+ method: 'POST',
+ ...(options || {}),
+ });
+}
+
+/** 删除规则 DELETE /api/rule */
+export async function removeRule(options?: { [key: string]: any }) {
+ return request<Record<string, any>>('/api/rule', {
+ method: 'DELETE',
+ ...(options || {}),
+ });
+}
diff --git a/react-ui/src/services/ant-design-pro/typings.d.ts b/react-ui/src/services/ant-design-pro/typings.d.ts
new file mode 100644
index 0000000..4ee1264
--- /dev/null
+++ b/react-ui/src/services/ant-design-pro/typings.d.ts
@@ -0,0 +1,108 @@
+declare namespace API {
+ type CurrentUser = UserInfo & {
+ signature?: string;
+ title?: string;
+ group?: string;
+ tags?: { key?: string; label?: string }[];
+ notifyCount?: number;
+ unreadCount?: number;
+ country?: string;
+ access?: string;
+ geographic?: {
+ province?: { label?: string; key?: string };
+ city?: { label?: string; key?: string };
+ };
+ address?: string;
+ phone?: string;
+ };
+
+ type ErrorResponse = {
+ /** 业务约定的错误码 */
+ errorCode: string;
+ /** 业务上的错误信息 */
+ errorMessage?: string;
+ /** 业务上的请求是否成功 */
+ success?: boolean;
+ };
+
+ type FakeCaptcha = {
+ code?: number;
+ status?: string;
+ };
+
+ type getFakeCaptchaParams = {
+ /** 手机号 */
+ phone?: string;
+ };
+
+ type LoginParams = {
+ username?: string;
+ password?: string;
+ uuid?: string;
+ autoLogin?: boolean;
+ type?: string;
+ };
+
+ type LoginResult = {
+ code: number;
+ msg?: string;
+ type?: string;
+ token?: string;
+ };
+
+ type NoticeIconItem = {
+ id?: string;
+ extra?: string;
+ key?: string;
+ read?: boolean;
+ avatar?: string;
+ title?: string;
+ status?: string;
+ datetime?: string;
+ description?: string;
+ type?: NoticeIconItemType;
+ };
+
+ type NoticeIconItemType = 'notification' | 'message' | 'event';
+
+ type NoticeIconList = {
+ data?: NoticeIconItem[];
+ /** 列表的内容总数 */
+ total?: number;
+ success?: boolean;
+ };
+
+ type PageParams = {
+ current?: number;
+ pageSize?: number;
+ };
+
+ type RuleList = {
+ data?: RuleListItem[];
+ /** 列表的内容总数 */
+ total?: number;
+ success?: boolean;
+ };
+
+ type RuleListItem = {
+ key?: number;
+ disabled?: boolean;
+ href?: string;
+ avatar?: string;
+ name?: string;
+ owner?: string;
+ desc?: string;
+ callNo?: number;
+ status?: number;
+ updatedAt?: string;
+ createdAt?: string;
+ progress?: number;
+ };
+
+ type ruleParams = {
+ /** 当前的页码 */
+ current?: number;
+ /** 页面的容量 */
+ pageSize?: number;
+ };
+}