fix: 根据配置隐藏多语言选择

This commit is contained in:
TsMask
2023-11-29 19:27:49 +08:00
parent 1784941670
commit 95fbce6b0e
9 changed files with 78 additions and 39 deletions

View File

@@ -8,6 +8,7 @@ import { useRouter, useRoute } from 'vue-router';
import useI18n from '@/hooks/useI18n';
import { toRaw } from 'vue';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { sessionGet } from '@/utils/cache-session-utils';
const { t, changeLocale, optionsLocale } = useI18n();
const appStore = useAppStore();
const router = useRouter();
@@ -115,6 +116,9 @@ onMounted(() => {
fnGetCaptcha();
});
// 兼容旧前端可改配置文件
const i18nDisable = sessionGet('i18nDisable') === 'false';
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -270,6 +274,7 @@ function fnChangeLocale(e: any) {
justify="space-between"
align="middle"
style="margin-top: 18px"
v-if="!i18nDisable"
>
<a-col :offset="18" :span="6">
<a-dropdown :trigger="['click', 'hover']">