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

178 lines
3.7 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;
2026-02-02 16:54:23 +08:00
message?: string;
2024-10-12 14:59:12 +08:00
};
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;
2026-01-04 23:45:55 +08:00
defaultLoginType?: string;
selfServicePasswordRetrievalEnabled?: boolean;
2024-11-28 17:36:45 +08:00
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;
2025-09-11 00:19:38 +08:00
captchaEnabled?: boolean;
captchaType?: number;
captchaAddonId?: number;
2025-10-23 00:05:36 +08:00
//流水线是否启用有效期
pipelineValidTimeEnabled?: boolean;
2025-12-26 18:17:05 +08:00
// 默认到期前更新天数
defaultCertRenewDays?: number;
// 默认即将到期天数
defaultWillExpireDays?: number;
2025-12-26 18:17:05 +08:00
2025-10-23 00:05:36 +08:00
//证书域名添加到监控
certDomainAddToMonitorEnabled?: boolean;
// 固定证书有效期天数0表示不固定
fixedCertExpireDays?: number;
2025-11-27 01:59:22 +08:00
// 第三方OAuth配置
oauthEnabled?: boolean;
2025-12-01 00:40:46 +08:00
// 是否自动注册用户
oauthAutoRegister?: boolean;
// 是否自动跳转第三方登录
oauthAutoRedirect?: boolean;
// 是否仅允许使用第三方登录
oauthOnly?: boolean;
// 第三方OAuth登录提供者配置
2025-11-27 01:59:22 +08:00
oauthProviders?: Record<
string,
{
type: string;
title: string;
addonId: number;
}
>;
2026-01-07 17:54:18 +08:00
// 系统通知
notice?: string;
2026-02-04 15:49:01 +08:00
// 管理员模式
adminMode?: "enterprise" | "saas";
};
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;
reverseProxies?: any;
2024-11-25 00:53:36 +08:00
dnsResultOrder?: string;
commonCnameEnabled?: boolean;
2025-12-26 18:17:05 +08:00
// 同一个用户同时最大运行流水线数量
pipelineMaxRunningCount?: number;
2024-11-28 17:36:45 +08:00
sms?: {
type?: string;
config?: any;
};
2025-10-23 00:05:36 +08:00
//http请求超时时间
httpRequestTimeout?: number;
2024-11-25 00:53:36 +08:00
};
export type SysInstallInfo = {
siteId: string;
2026-02-02 16:36:43 +08:00
bindUrl?: string;
bindUrl2?: 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
});
}