fix: self host embedding missing base url config (#1116)
This commit is contained in:
parent
b201eeedbd
commit
7ba068c3e4
1 changed files with 10 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import Modal from '@/app/components/base/modal'
|
||||||
import copyStyle from '@/app/components/app/chat/copy-btn/style.module.css'
|
import copyStyle from '@/app/components/app/chat/copy-btn/style.module.css'
|
||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
|
import { IS_CE_EDITION } from '@/config'
|
||||||
|
|
||||||
// const isDevelopment = process.env.NODE_ENV === 'development'
|
// const isDevelopment = process.env.NODE_ENV === 'development'
|
||||||
|
|
||||||
|
|
@ -30,7 +31,15 @@ const OPTION_MAP = {
|
||||||
scripts: {
|
scripts: {
|
||||||
getContent: (url: string, token: string, isTestEnv?: boolean) =>
|
getContent: (url: string, token: string, isTestEnv?: boolean) =>
|
||||||
`<script>
|
`<script>
|
||||||
window.difyChatbotConfig = { token: '${token}'${isTestEnv ? ', isDev: true' : ''} }
|
window.difyChatbotConfig = {
|
||||||
|
token: '${token}'${isTestEnv
|
||||||
|
? `,
|
||||||
|
isDev: true`
|
||||||
|
: ''}${IS_CE_EDITION
|
||||||
|
? `,
|
||||||
|
baseUrl: '${url}'`
|
||||||
|
: ''}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script
|
<script
|
||||||
src="${url}/embed.min.js"
|
src="${url}/embed.min.js"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue