feat: allow the embedding in websites to customize sys.user_id (#16062)
This commit is contained in:
parent
6cf258a809
commit
24b1a625b3
7 changed files with 83 additions and 24 deletions
|
|
@ -262,8 +262,9 @@ export const textToAudioStream = (url: string, isPublicAPI: boolean, header: { c
|
|||
return (getAction('post', !isPublicAPI))(url, { body, header }, { needAllResponseContent: true })
|
||||
}
|
||||
|
||||
export const fetchAccessToken = async (appCode: string) => {
|
||||
export const fetchAccessToken = async (appCode: string, userId?: string) => {
|
||||
const headers = new Headers()
|
||||
headers.append('X-App-Code', appCode)
|
||||
return get('/passport', { headers }) as Promise<{ access_token: string }>
|
||||
const url = userId ? `/passport?user_id=${encodeURIComponent(userId)}` : '/passport'
|
||||
return get(url, { headers }) as Promise<{ access_token: string }>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue