feat: 添加mock数据
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
}
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user