WRA1 修正企微运行验收门禁
这个提交包含在:
@@ -233,6 +233,7 @@ function buildEntryOauthCheck(config) {
|
||||
}
|
||||
|
||||
function buildSecretMatrix(config) {
|
||||
const checkinSyncEnabled = Boolean(config.wecomCheckinSyncEnabled);
|
||||
return {
|
||||
contact: {
|
||||
source: "WECOM_CONTACT_SECRET",
|
||||
@@ -251,6 +252,8 @@ function buildSecretMatrix(config) {
|
||||
endpoint: "POST /cgi-bin/checkin/getcheckindata",
|
||||
override: configured(config.wecomCheckinSecret),
|
||||
overrideEnv: configured(config.wecomCheckinSecret) ? "WECOM_CHECKIN_SECRET" : null,
|
||||
syncEnabled: checkinSyncEnabled,
|
||||
runtimeReadyMode: checkinSyncEnabled ? "sync_enabled" : "qa_read_only_sync_disabled",
|
||||
},
|
||||
messageAndOauth: {
|
||||
source: "WECOM_AGENT_SECRET",
|
||||
@@ -588,14 +591,6 @@ async function runCheckinReadCheck({
|
||||
};
|
||||
}
|
||||
|
||||
if (!config.wecomCheckinSyncEnabled) {
|
||||
return {
|
||||
...contract,
|
||||
status: "BLOCKED",
|
||||
reason: "wecom_checkin_sync_disabled",
|
||||
missing: ["WECOM_CHECKIN_SYNC_ENABLED=true"],
|
||||
};
|
||||
}
|
||||
if (!resolveCheckinSecret(config)) {
|
||||
return {
|
||||
...contract,
|
||||
@@ -614,12 +609,18 @@ async function runCheckinReadCheck({
|
||||
startDate: window.startDate,
|
||||
endDate: window.endDate,
|
||||
externalUserIds,
|
||||
requireSyncEnabled: false,
|
||||
});
|
||||
|
||||
return {
|
||||
...contract,
|
||||
status: result.ok ? "OK" : "BLOCKED",
|
||||
reason: result.code || null,
|
||||
syncEnabled: Boolean(config.wecomCheckinSyncEnabled),
|
||||
runtimeReadyMode: config.wecomCheckinSyncEnabled ? "sync_enabled" : "qa_read_only_sync_disabled",
|
||||
readiness: result.ok
|
||||
? (config.wecomCheckinSyncEnabled ? "readable_and_sync_enabled" : "readable_sync_disabled")
|
||||
: "blocked",
|
||||
window,
|
||||
userCount: externalUserIds.length,
|
||||
recordCount: Array.isArray(result.records) ? result.records.length : 0,
|
||||
|
||||
@@ -75,10 +75,11 @@ async function fetchWecomCheckinData({
|
||||
startDate,
|
||||
endDate,
|
||||
externalUserIds,
|
||||
requireSyncEnabled = true,
|
||||
fetchImpl = fetch,
|
||||
}) {
|
||||
const userIds = Array.from(new Set((externalUserIds ?? []).map((id) => toSafeString(id, 128)).filter(Boolean)));
|
||||
if (!config?.wecomCheckinSyncEnabled) {
|
||||
if (requireSyncEnabled && !config?.wecomCheckinSyncEnabled) {
|
||||
return {
|
||||
ok: false,
|
||||
skipped: true,
|
||||
|
||||
在新工单中引用
屏蔽一个用户