mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-28 17:18:09 +08:00
fix: not set web prefix use default (#19604)
This commit is contained in:
parent
fabfc7d4d8
commit
f005434769
@ -23,15 +23,13 @@ if (
|
||||
}
|
||||
else if (
|
||||
globalThis.document?.body?.getAttribute('data-api-prefix')
|
||||
&& globalThis.document?.body?.getAttribute('data-web-prefix')
|
||||
&& globalThis.document?.body?.getAttribute('data-pubic-api-prefix')
|
||||
&& globalThis.document?.body?.getAttribute('data-pubic-web-prefix')
|
||||
) {
|
||||
// Not build can not get env from process.env.NEXT_PUBLIC_ in browser https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser
|
||||
apiPrefix = globalThis.document.body.getAttribute('data-api-prefix') as string
|
||||
webPrefix = globalThis.document.body.getAttribute('data-web-prefix') as string
|
||||
webPrefix = (globalThis.document.body.getAttribute('data-web-prefix') as string || globalThis.location.origin)
|
||||
publicApiPrefix = globalThis.document.body.getAttribute('data-pubic-api-prefix') as string
|
||||
publicWebPrefix = globalThis.document.body.getAttribute('data-pubic-web-prefix') as string
|
||||
publicWebPrefix = (globalThis.document.body.getAttribute('data-pubic-web-prefix') as string || globalThis.location.origin)
|
||||
}
|
||||
else {
|
||||
// const domainParts = globalThis.location?.host?.split('.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user