diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts
index e18a28f1..151e976d 100644
--- a/src/i18n/locales/en-US.ts
+++ b/src/i18n/locales/en-US.ts
@@ -1107,6 +1107,10 @@ export default {
sysOfficialUrlOpen: 'Open the official website.',
sysOfficialUrlInstruction: 'Official website link address',
sysOfficialUrlInstruction1: 'start, if you need to hide do not jump to fill in the',
+ i18n: "Internationalization Switch",
+ i18nOpen: "Display Switch",
+ i18nDefault: "Default Languages",
+ i18nInstruction: 'Whether to display the internationalization switch and set the system default language',
},
role:{
allScopeOptions:'All data permissions',
diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts
index acff204e..5d168c85 100644
--- a/src/i18n/locales/zh-CN.ts
+++ b/src/i18n/locales/zh-CN.ts
@@ -1107,6 +1107,10 @@ export default {
sysOfficialUrlOpen: '打开官网',
sysOfficialUrlInstruction: '官网链接地址',
sysOfficialUrlInstruction1: '开头,如需隐藏不跳转填写',
+ i18n: "国际化切换",
+ i18nOpen: "显示切换",
+ i18nDefault: "默认语言",
+ i18nInstruction: '是否显示国际化切换,设置系统默认语言',
},
role:{
allScopeOptions:'全部数据权限',
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index 6257246c..71c7bcd3 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -2,7 +2,7 @@ import { getSysConf } from '@/api';
import { CACHE_LOCAL_I18N } from '@/constants/cache-keys-constants';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { parseUrlPath } from '@/plugins/file-static-url';
-import { localGet } from '@/utils/cache-local-utils';
+import { localGet, localSet } from '@/utils/cache-local-utils';
import { defineStore } from 'pinia';
/**应用参数类型 */
@@ -95,6 +95,11 @@ const useAppStore = defineStore('app', {
this.officialUrl = res.data.officialUrl;
this.i18nOpen = res.data.i18nOpen === 'true';
this.i18nDefault = res.data.i18nDefault;
+ // 切换禁用时,设置默认语言
+ const localI18n = localGet(CACHE_LOCAL_I18N);
+ if (localI18n == null || (!this.i18nOpen && this.i18nDefault)) {
+ localSet(CACHE_LOCAL_I18N, this.i18nDefault);
+ }
}
return res;
},
diff --git a/src/views/system/setting/components/change-i18n.vue b/src/views/system/setting/components/change-i18n.vue
new file mode 100644
index 00000000..3589e903
--- /dev/null
+++ b/src/views/system/setting/components/change-i18n.vue
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ opt.label }}
+
+
+
+
+
+
+ {{ t('views.system.setting.saveSubmit') }}
+
+
+ {{ t('common.cancel') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ opt.label }}
+
+
+
+
+
+ {{ t('common.editText') }}
+
+
+
+
+
+
+ {{ t('views.system.setting.i18nInstruction') }}
+
+
+
+
+
+
+
diff --git a/src/views/system/setting/index.vue b/src/views/system/setting/index.vue
index 2b021def..cfac504c 100644
--- a/src/views/system/setting/index.vue
+++ b/src/views/system/setting/index.vue
@@ -6,6 +6,7 @@ import ChangeTitle from './components/change-title.vue';
import ChangeCopyright from './components/change-copyright.vue';
import ChangeHelpDoc from './components/change-help-doc.vue';
import ChangeOfficialUrl from './components/change-official-url.vue';
+import ChangeI18n from './components/change-i18n.vue';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
@@ -29,14 +30,18 @@ const { t } = useI18n();
{{ t('views.system.setting.sysLoginBg') }}
-
+
{{ t('views.system.setting.sysHelpDoc') }}
-
+
{{ t('views.system.setting.sysOfficialUrl') }}
+
+ {{ t('views.system.setting.i18n') }}
+
+