This commit is contained in:
Your Name
2026-09-09 14:04:09 +08:00
parent 9be2e18ea6
commit 083fd857e8
7 changed files with 462 additions and 46 deletions
+11 -4
View File
@@ -21,20 +21,27 @@ const overview = {
dispatch_sync: { status: 1, desired_version: 2, applied_version: 1, last_error: '' }
}]
}
for (const id of [100, 101]) {
const pool = structuredClone(overview.pools[0])
Object.assign(pool, { id, name: `批量验证方案 ${id}`, public_key: `test-only-${id}` })
overview.pools.push(pool)
}
overview.summary.pool_count = overview.summary.online_links = overview.pools.length
const fixture = `const overview = ${JSON.stringify(overview)};
async function invoke(name, params) {
if (name === 'wecomPromotionOverview') return structuredClone(overview);
if (name === 'wecomPromotionSyncMemberRange') {
const pool = overview.pools[0];
if (new URLSearchParams(location.search).get('mode') === 'failure') {
const pool = overview.pools.find(item => item.id === params.pool_id);
const mode = new URLSearchParams(location.search).get('mode');
if (mode === 'failure' || (mode === 'mixed' && pool.id === 100)) {
pool.dispatch_sync.status = 3; pool.dispatch_sync.last_error = '模拟企微网络错误';
pool.member_rules.forEach(row => {row.sync_status = 3; row.sync_error = '模拟企微网络错误';});
return {pool_id:99,sync_status:'failed',sync_error:'模拟企微网络错误',sync_queued:true};
return {pool_id:pool.id,sync_status:'failed',sync_error:'模拟企微网络错误',sync_queued:true};
}
pool.official_link.range_userids = ['test_xuke']; pool.official_link.last_sync_time = Math.floor(Date.now()/1000);
pool.dispatch_sync = {status:0,desired_version:2,applied_version:2,last_error:''};
pool.member_rules.forEach(row => {row.is_in_remote_range = row.enabled === 1; row.sync_status = 0;});
return {pool_id:99,sync_status:'synced',sync_error:'',sync_queued:false,range_userids:['test_xuke'],range_department_ids:[]};
return {pool_id:pool.id,sync_status:'synced',sync_error:'',sync_queued:false,range_userids:['test_xuke'],range_department_ids:[]};
}
throw new Error('隔离页面未实现该操作:' + name);
}