diff --git a/src/assets/icons/lock.svg b/src/assets/icons/lock.svg new file mode 100644 index 0000000..470d48c --- /dev/null +++ b/src/assets/icons/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/AppLink/index.vue b/src/components/AppLink/index.vue index a3afe25..c863d44 100644 --- a/src/components/AppLink/index.vue +++ b/src/components/AppLink/index.vue @@ -26,15 +26,8 @@ const type = computed(() => { }); const linkProps = (to: string) => { - if (isExternalLink.value) { - return { - href: to, - target: "_blank", - rel: "noopener noreferrer", - }; - } - return { - to: to, - }; + return isExternalLink.value + ? { href: to, target: "_blank", rel: "noopener noreferrer" } + : { to }; }; diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index df9849d..ea2b1af 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -32,7 +32,7 @@ const pathCompile = (path: string) => { return toPath(params); }; -const breadcrumbs = ref([] as Array); +const breadcrumbs = ref>([]); function getBreadcrumb() { let matched = currentRoute.matched.filter( diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index 993af5d..867986c 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -6,13 +6,12 @@ @@ -30,16 +29,18 @@ defineProps({ }, }); +const langOptions = [ + { label: "中文", value: "zh-cn" }, + { label: "English", value: "en" }, +]; + const appStore = useAppStore(); -const { locale } = useI18n(); +const { locale, t } = useI18n(); function handleLanguageChange(lang: string) { locale.value = lang; appStore.changeLanguage(lang); - if (lang === "en") { - ElMessage.success("Switch Language Successful!"); - } else { - ElMessage.success("切换语言成功!"); - } + + ElMessage.success(t("langSelect.message.success")); } diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue index a5aa790..bfd5438 100644 --- a/src/components/SizeSelect/index.vue +++ b/src/components/SizeSelect/index.vue @@ -20,15 +20,19 @@ diff --git a/src/lang/package/en.ts b/src/lang/package/en.ts index e7bbb53..49c9d10 100644 --- a/src/lang/package/en.ts +++ b/src/lang/package/en.ts @@ -10,6 +10,18 @@ export default { password: "Password", login: "Login", captchaCode: "Verify Code", + message: { + username: { + required: "Please enter Username", + }, + password: { + required: "Please enter Password", + min: "The password can not be less than 6 digits", + }, + captchaCode: { + required: "Please enter Verify Code", + }, + }, }, // 导航栏国际化 navbar: { @@ -18,4 +30,29 @@ export default { document: "Document", gitee: "Gitee", }, + sizeSelect: { + tooltip: "Layout Size", + default: "Default", + large: "Large", + small: "Small", + message: { + success: "Switch Layout Size Successful!", + }, + }, + langSelect: { + message: { + success: "Switch Language Successful!", + }, + }, + settings: { + project: "Project Settings", + theme: "Theme", + interface: "Interface", + navigation: "Navigation", + themeColor: "Theme Color", + tagsView: "Tags View", + fixedHeader: "Fixed Header", + sidebarLogo: "Sidebar Logo", + watermark: "Watermark", + }, }; diff --git a/src/lang/package/zh-cn.ts b/src/lang/package/zh-cn.ts index ed90143..4b8bbda 100644 --- a/src/lang/package/zh-cn.ts +++ b/src/lang/package/zh-cn.ts @@ -10,12 +10,49 @@ export default { password: "密码", login: "登 录", captchaCode: "验证码", + message: { + username: { + required: "请输入用户名", + }, + password: { + required: "请输入密码", + min: "密码不能少于6位", + }, + captchaCode: { + required: "请输入验证码", + }, + }, }, // 导航栏国际化 navbar: { dashboard: "首页", - logout: "注销", + logout: "注销登出", document: "项目文档", - gitee: "码云", + gitee: "项目地址", + }, + sizeSelect: { + tooltip: "布局大小", + default: "默认", + large: "大型", + small: "小型", + message: { + success: "切换布局大小成功!", + }, + }, + langSelect: { + message: { + success: "切换语言成功!", + }, + }, + settings: { + project: "项目配置", + theme: "主题设置", + interface: "界面设置", + navigation: "导航设置", + themeColor: "主题颜色", + tagsView: "开启 Tags-View", + fixedHeader: "固定 Header", + sidebarLogo: "侧边栏 Logo", + watermark: "开启水印", }, }; diff --git a/src/layout/components/NavBar/components/NavbarRight.vue b/src/layout/components/NavBar/components/NavbarRight.vue index cf3c13b..2bd5598 100644 --- a/src/layout/components/NavBar/components/NavbarRight.vue +++ b/src/layout/components/NavBar/components/NavbarRight.vue @@ -9,7 +9,11 @@ - + @@ -32,13 +36,13 @@ target="_blank" href="https://gitee.com/youlaiorg/vue3-element-admin" > - 项目地址 + {{ $t("navbar.gitee") }} - 项目文档 + {{ $t("navbar.document") }} - 注销登出 + {{ $t("navbar.logout") }} diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 0460bf4..a2e3b46 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -1,6 +1,10 @@