From 91135260c016e00fddb16cb64279ae32b5a959ba Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:14:11 +0800 Subject: [PATCH] fix: Fix default language when chat language is null (#2204) * fix: Fix default language * fix: Fix default language when chat language is null --------- Co-authored-by: wangdan-fit2cloud --- ui/src/views/chat/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/views/chat/index.vue b/ui/src/views/chat/index.vue index 89bff9b067f..71b5cc31405 100644 --- a/ui/src/views/chat/index.vue +++ b/ui/src/views/chat/index.vue @@ -25,6 +25,7 @@ import useStore from '@/stores' import Auth from '@/views/chat/auth/index.vue' import { hexToRgba } from '@/utils/theme' import { useI18n } from 'vue-i18n' +import { getBrowserLang } from '@/locales/index' const { locale } = useI18n({ useScope: 'global' }) const route = useRoute() const { application, user } = useStore() @@ -80,7 +81,7 @@ const init_data_end = ref(false) const applicationAvailable = ref(true) function getAppProfile() { return application.asyncGetAppProfile(loading).then((res: any) => { - locale.value = res.data?.language + locale.value = res.data?.language || getBrowserLang() show_history.value = res.data?.show_history application_profile.value = res.data })