feat(platform,datalink,bill): add workflow job drilldown, safe record batch-edit, audit, and spec linkage diagnostics (v0.8.11)

This commit is contained in:
gitea committed 2026-09-29 20:00:55 +08:00
1 parent 2ec08033e0
commit a0ec7f95a7
37 files changed
+3958 -674

No files matched your search

+16 -4
View File
@@ -33,14 +33,24 @@ export function resolveCorpCluster(corp: { cluster?: string; baseUrl?: string })
// 内存缓存
const easoMemoryCache = new Map<
string,
{ token: string; hoseToken: string; expiresAt: number }
{ token: string; hoseToken: string; expiresAt: number; sourceAccessToken?: string }
>();
const unityMemoryCache = new Map<
string,
{ token: string; expiresAt: number }
{ token: string; expiresAt: number; sourceAccessToken?: string }
>();
export function clearUnityClientCache(corpId?: string): void {
if (!corpId) {
easoMemoryCache.clear();
unityMemoryCache.clear();
return;
}
easoMemoryCache.delete(`${corpId}:easo`);
unityMemoryCache.delete(`${corpId}:unity`);
}
function isExpired(entry: { expiresAt: number }, refreshTtl: number): boolean {
return Date.now() >= entry.expiresAt - refreshTtl * 1000;
}
@@ -120,7 +130,7 @@ export async function getEasoClient(corp: CorpConfig): Promise<{
// 检查内存缓存
const mem = easoMemoryCache.get(cacheKey);
if (mem && !isExpired(mem, refreshTtl)) {
if (mem && mem.sourceAccessToken === corp.credentials.accessToken && !isExpired(mem, refreshTtl)) {
return {
client: createAuthClient({
prefixUrl: EASO_BASE_URL,
@@ -171,6 +181,7 @@ export async function getEasoClient(corp: CorpConfig): Promise<{
token: easoToken,
hoseToken,
expiresAt: Date.now() + 2 * 60 * 60 * 1000, // 2小时
sourceAccessToken: corp.credentials.accessToken,
};
easoMemoryCache.set(cacheKey, entry);
@@ -203,7 +214,7 @@ export async function getUnityClient(corp: CorpConfig): Promise<{
const cacheKey = `${corp.id}:unity`;
const mem = unityMemoryCache.get(cacheKey);
if (mem && !isExpired(mem, refreshTtl)) {
if (mem && mem.sourceAccessToken === corp.credentials.accessToken && !isExpired(mem, refreshTtl)) {
return {
unityJwt: mem.token,
client: createAuthClient({
@@ -239,6 +250,7 @@ export async function getUnityClient(corp: CorpConfig): Promise<{
const entry = {
token: unityJwt,
expiresAt: Date.now() + 2 * 60 * 60 * 1000,
sourceAccessToken: corp.credentials.accessToken,
};
unityMemoryCache.set(cacheKey, entry);