feat: 添加mock数据

This commit is contained in:
zdl
2025-11-05 17:49:15 +08:00
parent a8d865f0d6
commit cb5258b480
3 changed files with 48 additions and 0 deletions

View File

@@ -108,4 +108,25 @@ export const posthogHandlers = [
);
}
}),
// PostHog feature flags 接口(特性标志查询)
http.post('https://us.i.posthog.com/flags/', async ({ request }) => {
try {
if (process.env.NODE_ENV === 'development' && process.env.REACT_APP_LOG_POSTHOG === 'true') {
console.log('[Mock] PostHog feature flags 请求:', request.url);
}
// 返回空的特性标志
return HttpResponse.json({
featureFlags: {},
featureFlagPayloads: {},
});
} catch (error) {
console.error('[Mock] PostHog flags handler error:', error);
return HttpResponse.json(
{ featureFlags: {}, featureFlagPayloads: {} },
{ status: 200 }
);
}
}),
];