Skip to content

Commit

Permalink
feat: add baidu conversion tracking (#3016)
Browse files Browse the repository at this point in the history
* feat: add baidu conversion tracking

* chore
  • Loading branch information
newfish-cmyk authored Oct 30, 2024
1 parent 946fda0 commit e361279
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion projects/app/src/pages/login/components/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
);

Expand Down
5 changes: 3 additions & 2 deletions projects/app/src/web/context/useInitApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<FastGPTFeConfigsType['scripts']>([]);
const [title, setTitle] = useState(process.env.SYSTEM_NAME || 'AI');
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion projects/app/src/web/support/user/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResLogin>(`/proApi/support/user/account/register/emailAndPhone`, {
username,
code,
inviterId,
bd_vid,
password: hashStr(password)
});

Expand Down

0 comments on commit e361279

Please sign in to comment.