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 <dan.wang@fit2cloud.com>
This commit is contained in:
shaohuzhang1 2025-02-10 15:14:11 +08:00 committed by GitHub
parent 9937b6156d
commit 91135260c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<boolean>(false)
const applicationAvailable = ref<boolean>(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
})