From e36127920880ea96e32b9cda92f5885d359b691d Mon Sep 17 00:00:00 2001 From: heheer Date: Wed, 30 Oct 2024 14:40:49 +0800 Subject: [PATCH] feat: add baidu conversion tracking (#3016) * feat: add baidu conversion tracking * chore --- projects/app/src/pages/login/components/RegisterForm.tsx | 3 ++- projects/app/src/web/context/useInitApp.ts | 5 +++-- projects/app/src/web/support/user/api.ts | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/app/src/pages/login/components/RegisterForm.tsx b/projects/app/src/pages/login/components/RegisterForm.tsx index 856e0656711c..044cb1bdf133 100644 --- a/projects/app/src/pages/login/components/RegisterForm.tsx +++ b/projects/app/src/pages/login/components/RegisterForm.tsx @@ -50,7 +50,8 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => { username, code, password, - inviterId: localStorage.getItem('inviterId') || undefined + inviterId: localStorage.getItem('inviterId') || undefined, + bd_vid: localStorage.getItem('bd_vid') || undefined }) ); diff --git a/projects/app/src/web/context/useInitApp.ts b/projects/app/src/web/context/useInitApp.ts index 340c40146a36..228c4d08423b 100644 --- a/projects/app/src/web/context/useInitApp.ts +++ b/projects/app/src/web/context/useInitApp.ts @@ -8,7 +8,7 @@ import { TrackEventName } from '../common/system/constants'; export const useInitApp = () => { const router = useRouter(); - const { hiId } = router.query as { hiId?: string }; + const { hiId, bd_vid } = router.query as { hiId?: string; bd_vid?: string }; const { loadGitStar, setInitd, feConfigs } = useSystemStore(); const [scripts, setScripts] = useState([]); const [title, setTitle] = useState(process.env.SYSTEM_NAME || 'AI'); @@ -59,7 +59,8 @@ export const useInitApp = () => { useEffect(() => { hiId && localStorage.setItem('inviterId', hiId); - }, [hiId]); + bd_vid && localStorage.setItem('bd_vid', bd_vid); + }, [bd_vid, hiId]); return { feConfigs, diff --git a/projects/app/src/web/support/user/api.ts b/projects/app/src/web/support/user/api.ts index 6b7147883f8d..2abeb127d037 100644 --- a/projects/app/src/web/support/user/api.ts +++ b/projects/app/src/web/support/user/api.ts @@ -30,17 +30,20 @@ export const postRegister = ({ username, password, code, - inviterId + inviterId, + bd_vid }: { username: string; code: string; password: string; inviterId?: string; + bd_vid?: string; }) => POST(`/proApi/support/user/account/register/emailAndPhone`, { username, code, inviterId, + bd_vid, password: hashStr(password) });