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:
parent
9937b6156d
commit
91135260c0
@ -25,6 +25,7 @@ import useStore from '@/stores'
|
|||||||
import Auth from '@/views/chat/auth/index.vue'
|
import Auth from '@/views/chat/auth/index.vue'
|
||||||
import { hexToRgba } from '@/utils/theme'
|
import { hexToRgba } from '@/utils/theme'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
import { getBrowserLang } from '@/locales/index'
|
||||||
const { locale } = useI18n({ useScope: 'global' })
|
const { locale } = useI18n({ useScope: 'global' })
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { application, user } = useStore()
|
const { application, user } = useStore()
|
||||||
@ -80,7 +81,7 @@ const init_data_end = ref<boolean>(false)
|
|||||||
const applicationAvailable = ref<boolean>(true)
|
const applicationAvailable = ref<boolean>(true)
|
||||||
function getAppProfile() {
|
function getAppProfile() {
|
||||||
return application.asyncGetAppProfile(loading).then((res: any) => {
|
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
|
show_history.value = res.data?.show_history
|
||||||
application_profile.value = res.data
|
application_profile.value = res.data
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user