mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: application set language error
This commit is contained in:
parent
c59a19bbcb
commit
20260df9a1
|
|
@ -374,6 +374,8 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
application_access_token.show_source = instance.get('show_source')
|
||||
if 'language' in instance and instance.get('language') is not None:
|
||||
application_access_token.language = instance.get('language')
|
||||
if 'language' not in instance or instance.get('language') is None:
|
||||
application_access_token.language = None
|
||||
application_access_token.save()
|
||||
application_setting_model = DBModelManage.get_model('application_setting')
|
||||
xpack_cache = DBModelManage.get_model('xpack_cache')
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ const emit = defineEmits(['refresh'])
|
|||
const displayFormRef = ref()
|
||||
const form = ref<any>({
|
||||
show_source: false,
|
||||
language: '',
|
||||
language: ''
|
||||
})
|
||||
|
||||
const detail = ref<any>(null)
|
||||
|
|
@ -72,14 +72,14 @@ watch(dialogVisible, (bool) => {
|
|||
if (!bool) {
|
||||
form.value = {
|
||||
show_source: false,
|
||||
language: '',
|
||||
language: ''
|
||||
}
|
||||
}
|
||||
})
|
||||
const open = (data: any, content: any) => {
|
||||
detail.value = content
|
||||
form.value.show_source = data.show_source
|
||||
form.value.language = data.language || getBrowserLang()
|
||||
form.value.language = data.language
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
|
|
@ -87,11 +87,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
const obj = {
|
||||
show_source: form.value.show_source,
|
||||
language: form.value.language
|
||||
}
|
||||
applicationApi.putAccessToken(id as string, obj, loading).then((res) => {
|
||||
applicationApi.putAccessToken(id as string, form.value, loading).then((res) => {
|
||||
emit('refresh')
|
||||
// @ts-ignore
|
||||
MsgSuccess(t('common.settingSuccess'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue