feat(auth): 实现全自动无感续杯 (401/即将过期自动重试换票) 与企业多身份唯一标识分层

This commit is contained in:
gitea committed 2026-08-27 11:04:41 +08:00
1 parent 189415cdac
commit b7a3bf2c03
7 files changed
+122 -17

No files matched your search

+11 -2
View File
@@ -26,9 +26,18 @@ export function resolveCorpConfig(
const selectedCorpId = requestedCorpId ?? configuredCorpId;
if (selectedCorpId) {
const corp = corps.find((item) => item.id === selectedCorpId);
// 1. 优先按身份/配置 ID 精确匹配 (如 uzU7pcWfScck00@17718556446)
let corp = corps.find((item) => item.id === selectedCorpId);
// 2. 其次按企业物理 ID 匹配 (如 uzU7pcWfScck00)
if (!corp) {
corp = corps.find(
(item) =>
item.corpId === selectedCorpId ||
item.credentials.corpId === selectedCorpId
);
}
if (corp) return corp;
throw new Error(`未找到企业 ID 为 ${selectedCorpId} 的企业配置`);
throw new Error(`未找到企业或身份标识为 [${selectedCorpId}] 的企业配置`);
}
if (!options.stateful) {