支持自部署需求管理、交付流程与飞书集成

This commit is contained in:
xyt committed 2026-11-25 12:40:33 +08:00
1 parent 4556a5b483
commit e22b66d9dd
148 files changed
+8300 -6393

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
export const feishuErrors: Record<string, string> = {
unavailable: '飞书登录暂未配置完成,请使用账号密码登录或联系管理员。',
expired: '飞书授权已过期或浏览器状态不匹配,请重新发起授权。',
denied: '已取消飞书授权,你可以重试或使用账号密码登录。',
unbound: '此飞书身份尚未关联账号,请重新使用飞书登录,系统会自动注册普通成员账号。',
conflict: '此飞书身份或系统账号已有绑定,请先解除原有绑定。',
tenant: '此飞书账号不属于允许登录的企业,请联系管理员。',
session: '系统登录状态已变化,请重新登录后绑定飞书。',
rate_limited: '登录尝试过于频繁,请稍后再试。',
source: '登录请求来源无效,请从系统访问地址重新打开;如持续出现,请联系管理员检查代理配置。',
failed: '飞书授权暂未完成,请重试;如持续失败,请联系管理员检查应用配置。',
};
export function feishuErrorMessage(code: unknown): string {
return typeof code === 'string' && Object.hasOwn(feishuErrors, code) ? feishuErrors[code] : '';
}
export type FeishuBinding = { name: string; boundAt: string } | null;
export type FeishuDelivery = {
id: string; demandId: string; revision: number; status: 'pending' | 'sending' | 'sent' | 'failed';
attempts: number; lastError: string | null; createdAt: string; sentAt: string | null;
};
export type FeishuDeliveryFilter = 'all' | 'failed';
export type FeishuStatus = {
loginConfigured: boolean; callbackUrl: string; tenantRestricted: boolean;
botConfigured: boolean; botSigned: boolean; configurationError: string | null;
deliveries: FeishuDelivery[];
deliveryFilter: FeishuDeliveryFilter; nextCursor: string | null; failedCount: number;
};