Pārlūkot izejas kodu

fix: not set web prefix use default (#19604)

tags/1.4.0
Joel pirms 5 mēnešiem
vecāks
revīzija
f005434769
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  1. 2
    4
      web/config/index.ts

+ 2
- 4
web/config/index.ts Parādīt failu

} }
else if ( else if (
globalThis.document?.body?.getAttribute('data-api-prefix') 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-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 // 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 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 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 { else {
// const domainParts = globalThis.location?.host?.split('.'); // const domainParts = globalThis.location?.host?.split('.');

Notiek ielāde…
Atcelt
Saglabāt