optimize: ♻️ 邮件模板配置枚举字段获取(待完成)
This commit is contained in:
parent
269a71532f
commit
ded5239925
|
@ -75,11 +75,6 @@ export const message = (message: string | VNode | (() => VNode), params?: Messag
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭所有 `Message` 消息提示函数
|
|
||||||
*/
|
|
||||||
export const closeAllMessage = (): void => ElMessage.closeAll();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库消息展示
|
* 仓库消息展示
|
||||||
* @param result
|
* @param result
|
||||||
|
|
|
@ -13,6 +13,7 @@ import globalization from '@/assets/svg/globalization.svg?component';
|
||||||
import Check from '@iconify-icons/ep/check';
|
import Check from '@iconify-icons/ep/check';
|
||||||
|
|
||||||
import LoginForm from '@/views/login/login-form.vue';
|
import LoginForm from '@/views/login/login-form.vue';
|
||||||
|
import { userI18nTypeStore } from '@/store/i18n/i18nType';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
|
@ -24,7 +25,8 @@ initStorage();
|
||||||
const { dataTheme, overallStyle, dataThemeChange } = useDataThemeChange();
|
const { dataTheme, overallStyle, dataThemeChange } = useDataThemeChange();
|
||||||
dataThemeChange(overallStyle.value);
|
dataThemeChange(overallStyle.value);
|
||||||
const { title, getDropdownItemStyle, getDropdownItemClass } = useNav();
|
const { title, getDropdownItemStyle, getDropdownItemClass } = useNav();
|
||||||
const { locale, translationCh, translationEn } = useTranslationLang();
|
const { locale, translation } = useTranslationLang();
|
||||||
|
const i18nTypeStore = userI18nTypeStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -39,15 +41,17 @@ const { locale, translationCh, translationEn } = useTranslationLang();
|
||||||
<globalization class="hover:text-primary hover:!bg-[transparent] w-[20px] h-[20px] ml-1.5 cursor-pointer outline-none duration-300" />
|
<globalization class="hover:text-primary hover:!bg-[transparent] w-[20px] h-[20px] ml-1.5 cursor-pointer outline-none duration-300" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu class="translation">
|
<el-dropdown-menu class="translation">
|
||||||
<el-dropdown-item :class="['dark:!text-white', getDropdownItemClass(locale, 'zh')]" :style="getDropdownItemStyle(locale, 'zh')" @click="translationCh">
|
<el-dropdown-item
|
||||||
<IconifyIconOffline v-show="locale === 'zh'" :icon="Check" class="check-zh" />
|
v-for="item in i18nTypeStore.translationTypeList"
|
||||||
简体中文
|
:key="item.key"
|
||||||
</el-dropdown-item>
|
:class="['dark:!text-white', getDropdownItemClass(locale, item.key)]"
|
||||||
<el-dropdown-item :class="['dark:!text-white', getDropdownItemClass(locale, 'en')]" :style="getDropdownItemStyle(locale, 'en')" @click="translationEn">
|
:style="getDropdownItemStyle(locale, item.key)"
|
||||||
<span v-show="locale === 'en'" class="check-en">
|
@click="translation(item.key)"
|
||||||
|
>
|
||||||
|
<span v-show="locale === item.key" class="check">
|
||||||
<IconifyIconOffline :icon="Check" />
|
<IconifyIconOffline :icon="Check" />
|
||||||
</span>
|
</span>
|
||||||
English
|
{{ item.value }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { useUserStore } from '@/store/system/user';
|
||||||
import { message } from '@/utils/message';
|
import { message } from '@/utils/message';
|
||||||
import { getTopMenu, initRouter } from '@/router/utils';
|
import { getTopMenu, initRouter } from '@/router/utils';
|
||||||
import Motion from './utils/motion';
|
import Motion from './utils/motion';
|
||||||
import type { FormInstance } from 'element-plus';
|
import { ElMessage, FormInstance } from 'element-plus';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
@ -76,6 +76,7 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
||||||
// 获取后端路由
|
// 获取后端路由
|
||||||
await initRouter();
|
await initRouter();
|
||||||
router.push(getTopMenu(true).path).then(() => {
|
router.push(getTopMenu(true).path).then(() => {
|
||||||
|
ElMessage.closeAll();
|
||||||
message(t('login.loginSuccess'), { type: 'success' });
|
message(t('login.loginSuccess'), { type: 'success' });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue