diff --git a/web/public/locales/zh-CN/translation.json b/web/public/locales/zh-CN/translation.json index b2622015cc..6e5f9e390e 100644 --- a/web/public/locales/zh-CN/translation.json +++ b/web/public/locales/zh-CN/translation.json @@ -400,7 +400,7 @@ "ToRegister": "去注册", "ToLogin": "去登录", "PasswordLogin": "密码登录", - "PhoneLogin": "验证码登录", + "PhoneLogin": "手机号登录", "Account": "用户名", "AccountPlaceholder": "请输入用户名", "Password": "密码", @@ -422,7 +422,7 @@ "PleaseBindUser": "请绑定对应用户", "Email": "邮箱", "EmailPlaceholder": "请输入你的邮箱", - "EmailLogin": "验证码登录" + "EmailLogin": "邮箱登录" }, "Time": "时间", "CreateTime": "创建时间", @@ -758,4 +758,4 @@ "Title": "Laf 新版本已经准备好了!", "Description": "点击立即更新" } -} \ No newline at end of file +} diff --git a/web/public/locales/zh/translation.json b/web/public/locales/zh/translation.json index 1703f8eb80..931f503789 100644 --- a/web/public/locales/zh/translation.json +++ b/web/public/locales/zh/translation.json @@ -400,7 +400,7 @@ "ToRegister": "去注册", "ToLogin": "去登录", "PasswordLogin": "密码登录", - "PhoneLogin": "验证码登录", + "PhoneLogin": "手机号登录", "Account": "用户名", "AccountPlaceholder": "请输入用户名", "Password": "密码", @@ -422,7 +422,7 @@ "PleaseBindUser": "请绑定对应用户", "Email": "邮箱", "EmailPlaceholder": "请输入你的邮箱", - "EmailLogin": "验证码登录" + "EmailLogin": "邮箱登录" }, "Time": "时间", "CreateTime": "创建时间", @@ -758,4 +758,4 @@ "Title": "Laf 新版本已经准备好了!", "Description": "点击立即更新" } -} \ No newline at end of file +} diff --git a/web/src/pages/auth/signin/index.tsx b/web/src/pages/auth/signin/index.tsx index 5919491549..960788f914 100644 --- a/web/src/pages/auth/signin/index.tsx +++ b/web/src/pages/auth/signin/index.tsx @@ -14,7 +14,7 @@ import LoginByPhonePanel from "./mods/LoginByPhonePanel"; import useAuthStore from "@/pages/auth/store"; import useGlobalStore from "@/pages/globalStore"; -type providersTypes = +export type providersTypes = | PROVIDER_NAME.EMAIL | PROVIDER_NAME.GITHUB | PROVIDER_NAME.PHONE @@ -78,13 +78,9 @@ export default function SignIn() { ) : currentProvider === PROVIDER_NAME.PASSWORD ? ( - defaultProvider.name === PROVIDER_NAME.PHONE - ? setCurrentProvider(PROVIDER_NAME.PHONE) - : setCurrentProvider(PROVIDER_NAME.EMAIL) - } + showPhoneSigninBtn={!!phoneProvider} + showEmailSigninBtn={!!emailProvider} + setCurrentProvider={setCurrentProvider} isDarkMode={darkMode} /> ) : null} diff --git a/web/src/pages/auth/signin/mods/LoginByPasswordPanel/index.tsx b/web/src/pages/auth/signin/mods/LoginByPasswordPanel/index.tsx index c2d7d0f9a2..2ff102ee3c 100644 --- a/web/src/pages/auth/signin/mods/LoginByPasswordPanel/index.tsx +++ b/web/src/pages/auth/signin/mods/LoginByPasswordPanel/index.tsx @@ -12,7 +12,9 @@ import { import { t } from "i18next"; import { OutlineViewOffIcon, OutlineViewOnIcon } from "@/components/CommonIcon"; -import { Routes } from "@/constants"; +import { PROVIDER_NAME, Routes } from "@/constants"; + +import { providersTypes } from "../.."; import { useGroupMemberAddMutation } from "@/pages/app/collaboration/service"; import { @@ -27,13 +29,13 @@ type FormData = { }; export default function LoginByPasswordPanel({ - switchLoginType, + setCurrentProvider, showSignupBtn, showPhoneSigninBtn, showEmailSigninBtn, isDarkMode, }: { - switchLoginType: () => void; + setCurrentProvider: (provider: providersTypes) => void; showSignupBtn: boolean; showPhoneSigninBtn: boolean; showEmailSigninBtn: boolean; @@ -159,12 +161,34 @@ export default function LoginByPasswordPanel({
)}
- {(showPhoneSigninBtn || showEmailSigninBtn) && ( - + )} + {showSignupBtn && showPhoneSigninBtn && ( +
+ +
+ )} + {showEmailSigninBtn && ( + )} - {showSignupBtn && (showPhoneSigninBtn || showEmailSigninBtn) && ( + {showSignupBtn && showEmailSigninBtn && (