优化组件页面代码
This commit is contained in:
@@ -37,7 +37,7 @@ import type { ProductDiscount } from "@/models/product_discount"
|
||||
const editUserSchema = z
|
||||
.object({
|
||||
id: z.number(),
|
||||
username: z.string().min(2, "用户名至少2个字符"),
|
||||
username: z.string().optional(),
|
||||
email: z.string().email("邮箱格式不正确").optional().or(z.literal("")),
|
||||
password: z.string().optional(),
|
||||
confirmPassword: z.string().optional(),
|
||||
@@ -230,7 +230,7 @@ export function UpdateDialog({
|
||||
control={control}
|
||||
render={({ field, fieldState }) => (
|
||||
<Field data-invalid={fieldState.invalid}>
|
||||
<FieldLabel>用户名 *</FieldLabel>
|
||||
<FieldLabel>用户名</FieldLabel>
|
||||
<Input {...field} placeholder="请输入用户名" />
|
||||
<FieldError>{fieldState.error?.message}</FieldError>
|
||||
</Field>
|
||||
@@ -258,7 +258,7 @@ export function UpdateDialog({
|
||||
<Input
|
||||
{...field}
|
||||
type="password"
|
||||
placeholder="留空则保持不变,修改请输入新密码(至少6位)"
|
||||
placeholder="选填,修改请输入新密码(至少6位)"
|
||||
/>
|
||||
<FieldError>{fieldState.error?.message}</FieldError>
|
||||
</Field>
|
||||
|
||||
Reference in New Issue
Block a user