fix: 根据配置隐藏多语言选择
This commit is contained in:
@@ -6,6 +6,7 @@ import useI18n from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useAlarmStore from '@/store/modules/alarm';
|
||||
import { sessionGet } from '@/utils/cache-session-utils';
|
||||
const { isFullscreen, toggle } = useFullscreen();
|
||||
const { t, changeLocale, optionsLocale } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
@@ -42,6 +43,9 @@ function fnClickHelpDoc(language?: string) {
|
||||
window.open(href, '_blank');
|
||||
}
|
||||
|
||||
// 兼容旧前端可改配置文件
|
||||
const i18nDisable = sessionGet('i18nDisable') === 'false';
|
||||
|
||||
/**改变多语言 */
|
||||
function fnChangeLocale(e: any) {
|
||||
changeLocale(e.key);
|
||||
@@ -81,7 +85,11 @@ function fnChangeLocale(e: any) {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<a-dropdown placement="bottom" :trigger="['click', 'hover']">
|
||||
<a-dropdown
|
||||
placement="bottom"
|
||||
:trigger="['click', 'hover']"
|
||||
v-if="!i18nDisable"
|
||||
>
|
||||
<a-button size="small" type="default">
|
||||
{{ t('i18n') }}
|
||||
<DownOutlined />
|
||||
|
||||
Reference in New Issue
Block a user