diff --git a/apps/web-antd/src/views/system/user/data.ts b/apps/web-antd/src/views/system/user/data.ts index 4bcb6a625..c7d155955 100644 --- a/apps/web-antd/src/views/system/user/data.ts +++ b/apps/web-antd/src/views/system/user/data.ts @@ -83,7 +83,7 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'email', label: '邮箱', component: 'Input', - rules: z.string().email('邮箱格式不正确').optional(), + rules: z.string().email('邮箱格式不正确').or(z.literal('')).optional(), }, { fieldName: 'mobile', diff --git a/apps/web-ele/src/views/system/dept/data.ts b/apps/web-ele/src/views/system/dept/data.ts index 1b112a599..b9eb72d68 100644 --- a/apps/web-ele/src/views/system/dept/data.ts +++ b/apps/web-ele/src/views/system/dept/data.ts @@ -95,7 +95,7 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入邮箱', }, - rules: z.string().email('请输入正确的邮箱地址').optional(), + rules: z.string().email('邮箱格式不正确').or(z.literal('')).optional(), }, { fieldName: 'status', diff --git a/apps/web-ele/src/views/system/user/data.ts b/apps/web-ele/src/views/system/user/data.ts index a16951c35..68e73756f 100644 --- a/apps/web-ele/src/views/system/user/data.ts +++ b/apps/web-ele/src/views/system/user/data.ts @@ -83,7 +83,7 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'email', label: '邮箱', component: 'Input', - rules: z.string().email('邮箱格式不正确').optional(), + rules: z.string().email('邮箱格式不正确').or(z.literal('')).optional(), }, { fieldName: 'mobile', diff --git a/apps/web-naive/src/views/system/dept/data.ts b/apps/web-naive/src/views/system/dept/data.ts index 1b112a599..b9eb72d68 100644 --- a/apps/web-naive/src/views/system/dept/data.ts +++ b/apps/web-naive/src/views/system/dept/data.ts @@ -95,7 +95,7 @@ export function useFormSchema(): VbenFormSchema[] { componentProps: { placeholder: '请输入邮箱', }, - rules: z.string().email('请输入正确的邮箱地址').optional(), + rules: z.string().email('邮箱格式不正确').or(z.literal('')).optional(), }, { fieldName: 'status', diff --git a/apps/web-naive/src/views/system/user/data.ts b/apps/web-naive/src/views/system/user/data.ts index 4bcb6a625..c7d155955 100644 --- a/apps/web-naive/src/views/system/user/data.ts +++ b/apps/web-naive/src/views/system/user/data.ts @@ -83,7 +83,7 @@ export function useFormSchema(): VbenFormSchema[] { fieldName: 'email', label: '邮箱', component: 'Input', - rules: z.string().email('邮箱格式不正确').optional(), + rules: z.string().email('邮箱格式不正确').or(z.literal('')).optional(), }, { fieldName: 'mobile',