|
|
@@ -18,7 +18,11 @@ export const PlatformSchema = z.object({
|
|
|
description: '联系电话',
|
|
|
example: '13800138000'
|
|
|
}),
|
|
|
- contactEmail: z.string().email().max(100).nullable().optional().openapi({
|
|
|
+ contactEmail: z.union([
|
|
|
+ z.literal(''),
|
|
|
+ z.null(),
|
|
|
+ z.string().email().max(100)
|
|
|
+ ]).optional().openapi({
|
|
|
description: '联系邮箱',
|
|
|
example: 'zhangsan@example.com'
|
|
|
}),
|
|
|
@@ -57,6 +61,7 @@ export const CreatePlatformSchema = z.object({
|
|
|
example: '13800138000'
|
|
|
}),
|
|
|
contactEmail: z.union([
|
|
|
+ z.literal(''),
|
|
|
z.literal('').optional(), // 空字符串或undefined
|
|
|
z.string().email({
|
|
|
message: '请输入有效的邮箱地址'
|
|
|
@@ -88,6 +93,7 @@ export const UpdatePlatformSchema = z.object({
|
|
|
example: '13800138000'
|
|
|
}),
|
|
|
contactEmail: z.union([
|
|
|
+ z.literal(''),
|
|
|
z.literal('').optional(), // 空字符串或undefined
|
|
|
z.string().email({
|
|
|
message: '请输入有效的邮箱地址'
|