Files
certd/packages/ui/certd-client/src/store/settings/api.basic.ts

125 lines
2.4 KiB
TypeScript
Raw Normal View History

2025-04-12 23:59:03 +08:00
import { request } from "/src/api/service";
2024-10-12 14:59:12 +08:00
export type SiteEnv = {
agent?: {
enabled?: boolean;
contactText?: string;
contactLink?: string;
};
};
2025-03-24 18:39:22 +08:00
export type AppInfo = {
version?: string;
time?: number;
deltaTime?: number;
};
2024-10-12 14:59:12 +08:00
export type SiteInfo = {
2024-10-12 16:49:49 +08:00
title?: string;
slogan?: string;
logo?: string;
loginLogo?: string;
icpNo?: string;
2024-10-12 14:59:12 +08:00
licenseTo?: string;
licenseToUrl?: string;
};
export type PlusInfo = {
vipType?: string;
expireTime?: number;
isPlus: boolean;
isComm?: boolean;
};
export type SysPublicSetting = {
2024-11-25 00:53:36 +08:00
registerEnabled?: boolean;
2025-06-04 23:00:37 +08:00
userValidTimeEnabled?: boolean;
2024-11-28 17:36:45 +08:00
usernameRegisterEnabled?: boolean;
mobileRegisterEnabled?: boolean;
emailRegisterEnabled?: boolean;
passwordLoginEnabled?: boolean;
smsLoginEnabled?: boolean;
2024-11-25 00:53:36 +08:00
limitUserPipelineCount?: number;
managerOtherUserPipeline?: boolean;
icpNo?: string;
2025-05-10 21:31:32 +08:00
mpsNo?: string;
robots?: boolean;
2025-05-15 23:06:22 +08:00
aiChatEnabled?: boolean;
2025-06-30 23:48:00 +08:00
showRunStrategy?: boolean;
};
2024-12-25 00:52:39 +08:00
export type SuiteSetting = {
enabled?: boolean;
};
2024-11-25 00:53:36 +08:00
export type SysPrivateSetting = {
httpProxy?: string;
httpsProxy?: string;
dnsResultOrder?: string;
commonCnameEnabled?: boolean;
2024-11-28 17:36:45 +08:00
sms?: {
type?: string;
config?: any;
};
2024-11-25 00:53:36 +08:00
};
export type SysInstallInfo = {
siteId: string;
};
2024-10-25 23:56:24 +08:00
export type MenuItem = {
id: string;
title: string;
icon?: string;
path?: string;
children?: MenuItem[];
};
export type HeaderMenus = {
menus: MenuItem[];
};
2024-10-12 14:59:12 +08:00
export type AllSettings = {
sysPublic: SysPublicSetting;
installInfo: SysInstallInfo;
plusInfo: PlusInfo;
siteInfo: SiteInfo;
siteEnv: SiteEnv;
2024-10-25 23:56:24 +08:00
headerMenus: HeaderMenus;
2024-12-25 00:52:39 +08:00
suiteSetting: SuiteSetting;
2025-03-24 18:39:22 +08:00
app: AppInfo;
2024-10-12 14:59:12 +08:00
};
2024-09-24 02:42:08 +08:00
2024-10-12 14:59:12 +08:00
export async function loadAllSettings(): Promise<AllSettings> {
2024-10-10 18:38:22 +08:00
return await request({
2024-10-12 14:59:12 +08:00
url: "/basic/settings/all",
2025-03-24 18:39:22 +08:00
method: "get",
2024-10-10 18:38:22 +08:00
});
}
2024-09-24 02:42:08 +08:00
2024-10-10 18:38:22 +08:00
export async function bindUrl(data: any): Promise<any> {
2024-09-24 02:42:08 +08:00
return await request({
url: "/sys/plus/bindUrl",
method: "post",
2025-03-24 18:39:22 +08:00
data,
2024-09-24 02:42:08 +08:00
});
}
2024-11-28 17:36:45 +08:00
export async function sendSmsCode(data: any): Promise<any> {
return await request({
url: "/basic/code/sendSmsCode",
method: "post",
2025-03-24 18:39:22 +08:00
data,
2024-11-28 17:36:45 +08:00
});
}
export async function sendEmailCode(data: any): Promise<any> {
return await request({
url: "/basic/code/sendEmailCode",
method: "post",
2025-03-24 18:39:22 +08:00
data,
2024-11-28 17:36:45 +08:00
});
}
2025-04-27 22:51:47 +08:00
export async function getProductInfo(): Promise<any> {
return await request({
url: "/basic/settings/productInfo",
method: "get",
2025-05-29 09:41:21 +08:00
showErrorNotify: false,
2025-04-27 22:51:47 +08:00
});
}