fix select

This commit is contained in:
Chuck1sn
2025-05-19 11:19:21 +08:00
parent dd3c92172e
commit f5a57f9d69

View File

@@ -83,7 +83,7 @@ const updateFormData = (newUser: typeof user) => {
id: newUser?.id, id: newUser?.id,
username: newUser?.username, username: newUser?.username,
password: undefined, password: undefined,
enable: newUser?.enable, enable: newUser?.enable ?? true,
confirmPassword: undefined, confirmPassword: undefined,
}; };
}; };
@@ -102,7 +102,9 @@ const handleSubmit = async () => {
}) })
.min(4, "用户名至少4个字符") .min(4, "用户名至少4个字符")
.max(15, "用户名最多15个字符"), .max(15, "用户名最多15个字符"),
enable: z.boolean(), enable: z.boolean({
message: "状态不能为空",
}),
password: z password: z
.string({ .string({
message: "密码不能为空", message: "密码不能为空",