From 87d3e7591b4d228f8a0fb8575050c88d09d1f8a6 Mon Sep 17 00:00:00 2001 From: Ryan Su Date: Thu, 15 Aug 2024 14:49:43 +0800 Subject: [PATCH] fix: dynamic locale value --- src/store/modules/dynamicConfig.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/store/modules/dynamicConfig.ts b/src/store/modules/dynamicConfig.ts index 56febea7..6d8d3b26 100644 --- a/src/store/modules/dynamicConfig.ts +++ b/src/store/modules/dynamicConfig.ts @@ -48,7 +48,14 @@ export const useDynamicConfigStore = defineStore('app-dynamic-config', { this.showSettingButton = v.value !== undefined && v.value === 'true'; break; case 'sys.ui.defaultLocale': - this.defaultLocale = v.value !== undefined ? v.value : LOCALE.ZH_CN; + let localeValue: string = LOCALE.ZH_CN; + if (v.value !== undefined) { + if (v.value === LOCALE.ZH_CN || v.value === LOCALE.EN_US) { + localeValue = v.value; + } + } + + this.defaultLocale = localeValue; break; case 'sys.ui.header.showNotice': this.showNotice = v.value !== undefined && v.value === 'true';