fix: use NextJS basePath and WEB_PREFIX to support custom prefix (#19497)

Co-authored-by: johnny0120 <15564476+johnny0120@users.noreply.github.com>
This commit is contained in:
johnny0120 2025-05-12 13:44:41 +08:00 • committed by GitHub
commit 49af07f444
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 87 additions and 69 deletions

View file

@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react'
import { RiArrowDownSLine } from '@remixicon/react'
import cn from '@/utils/classnames'
import { basePath } from '@/utils/var'
import { WEB_PREFIX } from '@/config'
import PlanBadge from '@/app/components/header/plan-badge'
import { switchWorkspace } from '@/service/common'
import { useWorkspacesContext } from '@/context/workspace-context'
@ -23,7 +23,7 @@ const WorkplaceSelector = () => {
return
await switchWorkspace({ url: '/workspaces/switch', body: { tenant_id } })
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
location.assign(`${location.origin}${basePath}`)
location.assign(WEB_PREFIX)
}
catch {
notify({ type: 'error', message: t('common.provider.saveFailed') })