fix: 是否i显示国际化切换的开关

This commit is contained in:
TsMask
2023-12-04 18:19:11 +08:00
parent 12643cac12
commit 27cc02e0d6
3 changed files with 5 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { message } from 'ant-design-vue/lib';
import { reactive, onMounted, computed, ref } from 'vue';
import { reactive, onMounted, computed } from 'vue';
import useUserStore from '@/store/modules/user';
import useAppStore from '@/store/modules/app';
import { getCaptchaImage } from '@/api/login';
@@ -8,7 +8,6 @@ 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';
import { parseUrlPath } from '@/plugins/file-static-url';
const { t, changeLocale, optionsLocale, currentLocale } = useI18n();
const appStore = useAppStore();
@@ -133,9 +132,6 @@ onMounted(() => {
fnGetCaptcha();
});
// 兼容旧前端可改配置文件
const i18nDisable = sessionGet('i18nDisable') === 'false';
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -283,7 +279,7 @@ function fnChangeLocale(e: any) {
justify="space-between"
align="middle"
style="margin-top: 18px"
v-if="!i18nDisable"
v-if="appStore.i18nOpen"
>
<a-col :offset="18" :span="6">
<a-dropdown :trigger="['click', 'hover']">