This commit is contained in:
parent
dba0371580
commit
6b450fc03a
|
|
@ -138,11 +138,12 @@ export const ProfileSettings: FC<ProfileSettingsProps> = ({}) => {
|
||||||
const locales = i18nConfig.locales
|
const locales = i18nConfig.locales
|
||||||
const defaultLocale = i18nConfig.defaultLocale
|
const defaultLocale = i18nConfig.defaultLocale
|
||||||
|
|
||||||
let locale = defaultLocale
|
let locale: (typeof locales)[number] = defaultLocale
|
||||||
|
|
||||||
// 动态判断首段是否是合法语言代码
|
const segment = pathSegments[0] as (typeof locales)[number]
|
||||||
if (locales.includes(pathSegments[0])) {
|
|
||||||
locale = pathSegments[0]
|
if (locales.includes(segment)) {
|
||||||
|
locale = segment
|
||||||
}
|
}
|
||||||
|
|
||||||
const loginPath = locale === defaultLocale ? "/login" : `/${locale}/login`
|
const loginPath = locale === defaultLocale ? "/login" : `/${locale}/login`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue