Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
286138a4
authored
Jul 10, 2025
by
Zhuangzai fa
Committed by
GitHub
Jul 10, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bing ad (#5195)
* Bing Ad * Add msclkid parameter to login provider and registration API
parent
9b24b356
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
2 deletions
+30
-2
packages/global/support/marketing/type.d.ts
+1
-0
projects/app/src/pageComponents/login/RegisterForm.tsx
+2
-0
projects/app/src/pages/login/provider.tsx
+2
-0
projects/app/src/web/context/useInitApp.ts
+15
-2
projects/app/src/web/support/marketing/utils.ts
+8
-0
projects/app/src/web/support/user/api.ts
+2
-0
No files found.
packages/global/support/marketing/type.d.ts
View file @
286138a4
...
...
@@ -7,6 +7,7 @@ export type ShortUrlParams = {
export
type
TrackRegisterParams
=
{
inviterId
?:
string
;
bd_vid
?:
string
;
msclkid
?:
string
;
fastgpt_sem
?:
{
keyword
?:
string
;
}
&
ShortUrlParams
;
...
...
projects/app/src/pageComponents/login/RegisterForm.tsx
View file @
286138a4
...
...
@@ -16,6 +16,7 @@ import {
getBdVId
,
getFastGPTSem
,
getInviterId
,
getMsclkid
,
getSourceDomain
,
removeFastGPTSem
}
from
'@/web/support/marketing/utils'
;
...
...
@@ -60,6 +61,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
password
,
inviterId
:
getInviterId
(),
bd_vid
:
getBdVId
(),
msclkid
:
getMsclkid
(),
fastgpt_sem
:
getFastGPTSem
(),
sourceDomain
:
getSourceDomain
()
})
...
...
projects/app/src/pages/login/provider.tsx
View file @
286138a4
...
...
@@ -15,6 +15,7 @@ import {
getBdVId
,
getFastGPTSem
,
getInviterId
,
getMsclkid
,
getSourceDomain
,
removeFastGPTSem
}
from
'@/web/support/marketing/utils'
;
...
...
@@ -49,6 +50,7 @@ const provider = () => {
callbackUrl
:
`
${
location
.
origin
}
/login/provider`
,
inviterId
:
getInviterId
(),
bd_vid
:
getBdVId
(),
msclkid
:
getMsclkid
(),
fastgpt_sem
:
getFastGPTSem
(),
sourceDomain
:
getSourceDomain
()
});
...
...
projects/app/src/web/context/useInitApp.ts
View file @
286138a4
...
...
@@ -11,6 +11,7 @@ import {
setBdVId
,
setFastGPTSem
,
setInviterId
,
setMsclkid
,
setSourceDomain
,
setUtmParams
,
setUtmWorkflow
...
...
@@ -20,6 +21,7 @@ import { type ShortUrlParams } from '@fastgpt/global/support/marketing/type';
type
MarketingQueryParams
=
{
hiId
?:
string
;
bd_vid
?:
string
;
msclkid
?:
string
;
k
?:
string
;
sourceDomain
?:
string
;
utm_source
?:
string
;
...
...
@@ -31,6 +33,7 @@ type MarketingQueryParams = {
const
MARKETING_PARAMS
:
(
keyof
MarketingQueryParams
)[]
=
[
'hiId'
,
'bd_vid'
,
'msclkid'
,
'k'
,
'sourceDomain'
,
'utm_source'
,
...
...
@@ -41,8 +44,17 @@ const MARKETING_PARAMS: (keyof MarketingQueryParams)[] = [
export
const
useInitApp
=
()
=>
{
const
router
=
useRouter
();
const
{
hiId
,
bd_vid
,
k
,
sourceDomain
,
utm_source
,
utm_medium
,
utm_content
,
utm_workflow
}
=
router
.
query
as
MarketingQueryParams
;
const
{
hiId
,
bd_vid
,
msclkid
,
k
,
sourceDomain
,
utm_source
,
utm_medium
,
utm_content
,
utm_workflow
}
=
router
.
query
as
MarketingQueryParams
;
const
{
loadGitStar
,
setInitd
,
feConfigs
}
=
useSystemStore
();
const
{
userInfo
}
=
useUserStore
();
...
...
@@ -121,6 +133,7 @@ export const useInitApp = () => {
useMount
(()
=>
{
setInviterId
(
hiId
);
setBdVId
(
bd_vid
);
setMsclkid
(
msclkid
);
setUtmWorkflow
(
utm_workflow
);
setSourceDomain
(
sourceDomain
);
...
...
projects/app/src/web/support/marketing/utils.ts
View file @
286138a4
...
...
@@ -22,6 +22,14 @@ export const setBdVId = (bdVid?: string) => {
sessionStorage
.
setItem
(
'bd_vid'
,
bdVid
);
};
export
const
getMsclkid
=
()
=>
{
return
sessionStorage
.
getItem
(
'msclkid'
)
||
undefined
;
};
export
const
setMsclkid
=
(
msclkid
?:
string
)
=>
{
if
(
!
msclkid
)
return
;
sessionStorage
.
setItem
(
'msclkid'
,
msclkid
);
};
export
const
getUtmWorkflow
=
()
=>
{
return
localStorage
.
getItem
(
'utm_workflow'
)
||
undefined
;
};
...
...
projects/app/src/web/support/user/api.ts
View file @
286138a4
...
...
@@ -37,6 +37,7 @@ export const postRegister = ({
code
,
inviterId
,
bd_vid
,
msclkid
,
fastgpt_sem
}:
AccountRegisterBody
)
=>
POST
<
ResLogin
>
(
`/proApi/support/user/account/register/emailAndPhone`
,
{
...
...
@@ -44,6 +45,7 @@ export const postRegister = ({
code
,
inviterId
,
bd_vid
,
msclkid
,
fastgpt_sem
,
password
:
hashStr
(
password
)
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment