From 53135e13adaa7bf789c211c5d4759b5fa98c1429 Mon Sep 17 00:00:00 2001 From: Seven Date: Thu, 15 Jan 2026 02:59:23 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E5=92=8C=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=8F=8A=E6=B3=A8=E5=86=8C=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E5=92=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types.ts | 2 + src/auth/index.ts | 23 ++++ .../login/components/email-password-login.vue | 95 ++++++++++++++++ src/views/auth/login/index.vue | 27 ++++- src/views/auth/signup/index.vue | 104 +++++++++++++++++- 5 files changed, 246 insertions(+), 5 deletions(-) create mode 100644 src/views/auth/login/components/email-password-login.vue diff --git a/src/api/types.ts b/src/api/types.ts index 43358d9..fc802bc 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -60,6 +60,8 @@ export type UsernameClient = TreatyBody; export type EmailVerifyClient = TreatyBody; +export type EmailPasswordVerifyClient = TreatyBody; + export type UserDepositOrderData = Treaty.Data["data"][number]; export type UserDepositOrderBody = TreatyQuery; diff --git a/src/auth/index.ts b/src/auth/index.ts index a458e2b..e62811b 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -72,3 +72,26 @@ export const countries: PhoneCountry[] = [ icon: CircleFlagsEnUs, }, ]; + +export const emailPasswordSchema = toTypedSchema(z.object({ + email: z + .string({ message: i18n.global.t("auth.signup.validation.emailRequired") }) + .min(1, i18n.global.t("auth.signup.validation.emailRequired")) + .email(i18n.global.t("auth.signup.validation.emailInvalid")), + password: z + .string({ message: i18n.global.t("auth.signup.validation.passwordRequired") }) + .min(8, i18n.global.t("auth.signup.validation.passwordMinLength", { length: 8 })), +})); + +export const emailSignupSchema = toTypedSchema(z.object({ + name: z + .string({ message: i18n.global.t("auth.signup.validation.nameRequired") }) + .min(1, i18n.global.t("auth.signup.validation.nameRequired")), + email: z + .string({ message: i18n.global.t("auth.signup.validation.emailRequired") }) + .min(1, i18n.global.t("auth.signup.validation.emailRequired")) + .email(i18n.global.t("auth.signup.validation.emailInvalid")), + password: z + .string({ message: i18n.global.t("auth.signup.validation.passwordRequired") }) + .min(8, i18n.global.t("auth.signup.validation.passwordMinLength", { length: 8 })), +})); diff --git a/src/views/auth/login/components/email-password-login.vue b/src/views/auth/login/components/email-password-login.vue new file mode 100644 index 0000000..38b07d6 --- /dev/null +++ b/src/views/auth/login/components/email-password-login.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/views/auth/login/index.vue b/src/views/auth/login/index.vue index 6584413..58cf9bd 100644 --- a/src/views/auth/login/index.vue +++ b/src/views/auth/login/index.vue @@ -1,7 +1,8 @@