2025-04-12 23:59:03 +08:00
|
|
|
|
import { request } from "/src/api/service";
|
2024-06-16 00:20:02 +08:00
|
|
|
|
|
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
|
|
|
|
};
|
2024-06-16 00:20:02 +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;
|
2025-07-24 16:56:22 +08:00
|
|
|
|
selfServicePasswordRetrievalEnabled?: boolean;
|
2024-11-28 17:36:45 +08:00
|
|
|
|
|
2024-11-25 00:53:36 +08:00
|
|
|
|
limitUserPipelineCount?: number;
|
|
|
|
|
|
managerOtherUserPipeline?: boolean;
|
2024-10-03 23:11:50 +08:00
|
|
|
|
icpNo?: string;
|
2025-05-10 21:31:32 +08:00
|
|
|
|
mpsNo?: string;
|
2025-02-27 00:10:07 +08:00
|
|
|
|
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;
|
2026-01-29 00:38:33 +08:00
|
|
|
|
// 默认即将到期天数
|
|
|
|
|
|
defaultWillExpireDays?: number;
|
2025-12-26 18:17:05 +08:00
|
|
|
|
|
2025-10-23 00:05:36 +08:00
|
|
|
|
//证书域名添加到监控
|
|
|
|
|
|
certDomainAddToMonitorEnabled?: boolean;
|
2025-11-06 23:20:02 +08:00
|
|
|
|
|
|
|
|
|
|
// 固定证书有效期天数,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-08-05 12:49:44 +08:00
|
|
|
|
};
|
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;
|
2026-02-07 02:20:27 +08:00
|
|
|
|
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
|
|
|
|
};
|
2024-08-25 01:55:34 +08:00
|
|
|
|
export type SysInstallInfo = {
|
|
|
|
|
|
siteId: string;
|
2026-02-02 16:36:43 +08:00
|
|
|
|
bindUrl?: string;
|
|
|
|
|
|
bindUrl2?: string;
|
2024-08-25 01:55:34 +08:00
|
|
|
|
};
|
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-08-25 01:55:34 +08:00
|
|
|
|
|
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
|
|
|
|
});
|
|
|
|
|
|
}
|