Files
ClassHelper/packages/server/src/modules/auth/auth.schemas.ts
T

14 lines
505 B
TypeScript
Raw Normal View History

import { z } from 'zod';
export const loginSchema = z.object({
username: z.string().trim().min(1, '请输入用户名').max(64),
password: z.string().min(1, '请输入密码').max(128),
});
export const changePasswordSchema = z.object({
currentPassword: z.string().min(1, '请输入当前密码'),
newPassword: z.string().min(6, '新密码至少 6 位').max(128),
});
export type LoginInput = z.infer<typeof loginSchema>;
export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;