55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { http } from "@/utils/http";
|
|
import { baseUri } from "@/api/utils";
|
|
|
|
// 获取服务端信息
|
|
export const getClients = (params?: object) => {
|
|
return http.request<any>("get", baseUri("/client/list"), { params });
|
|
};
|
|
|
|
// 下载客户端配置文件
|
|
export const downloadClient = (id: string) => {
|
|
return http.request<any>("post", baseUri("/client/download/" + id), null, {
|
|
responseType: "arraybuffer"
|
|
});
|
|
};
|
|
|
|
// 客户端IP生成
|
|
export const generateClientIP = (data?: object) => {
|
|
return http.request<any>("post", baseUri("/client/assignIP"), { data });
|
|
};
|
|
|
|
// 生成客户端密钥对
|
|
export const generateClientKeys = () => {
|
|
return http.request<any>("post", baseUri("/client/generate-keys"));
|
|
};
|
|
|
|
// 获取客户端配置二维码
|
|
export const clientQrCode = (id: string) => {
|
|
return http.request<any>("post", baseUri("/client/generate-qrcode/" + id));
|
|
};
|
|
|
|
// 新增/更新客户端信息
|
|
export const saveClient = (data?: object) => {
|
|
return http.request<any>("post", baseUri("/client/save"), { data });
|
|
};
|
|
|
|
// 删除客户端
|
|
export const deleteClient = (id: string) => {
|
|
return http.request<any>("delete", baseUri("/client/" + id));
|
|
};
|
|
|
|
// 获取客户端链接状态列表
|
|
export const getClientConnects = () => {
|
|
return http.request<any>("get", baseUri("/client/status"));
|
|
};
|
|
|
|
// 强制下线客户端
|
|
export const offlineClient = (id: string) => {
|
|
return http.request<any>("post", baseUri("/client/offline/" + id));
|
|
};
|
|
|
|
// 发送邮件
|
|
export const sendMail = (id: string) => {
|
|
return http.request<any>("post", baseUri("/client/to-email/" + id));
|
|
};
|