diff --git a/src/api/robot.ts b/src/api/robot.ts new file mode 100644 index 0000000..1e1cbb0 --- /dev/null +++ b/src/api/robot.ts @@ -0,0 +1,49 @@ +import { http } from "@/utils/http"; +import { BaseResponse } from "@/api/base"; + +/** 机器人信息 */ +export type RobotInfo = { + id: string; + createdAt: string; + updatedAt: string; + wxid: string; + account: string; + name: string; + avatar: string; + mobile: string; + currentDataPath: string; + dataSavePath: string; + dbKey: string; + hookApi: string; + remark: string; + version: number; + vncUrl: string; + tag: string; + /* 页面使用参数,后端不返回 */ + saveLoading: boolean; + edit: boolean; +}; + +/** 获取所有机器人 */ +export const getAllRobot = (data: any) => { + return http.request>>( + "get", + "/admin/v1/robot", + { data } + ); +}; + +/* 保存机器人 */ +export const saveRobot = (data: any) => { + return http.request>("post", "/admin/v1/robot", { + data + }); +}; + +/* 删除机器人信息 */ +export const deleteRobot = (id: string) => { + return http.request>( + "delete", + `/admin/v1/robot/${id}` + ); +}; diff --git a/src/assets/defaultWeChatAvatar.gif b/src/assets/defaultWeChatAvatar.gif new file mode 100644 index 0000000..4237656 Binary files /dev/null and b/src/assets/defaultWeChatAvatar.gif differ diff --git a/src/views/infra/robot/index.vue b/src/views/infra/robot/index.vue index d0f12a1..7a05697 100644 --- a/src/views/infra/robot/index.vue +++ b/src/views/infra/robot/index.vue @@ -1,12 +1,368 @@