From b7329ec2ad785af7971253f9e7a9c8fb40c5e613 Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <996881204@qq.com> Date: Mon, 18 Nov 2024 01:27:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20DingtalkOption=20?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/push/dingtalk.ts | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/push/dingtalk.ts b/src/push/dingtalk.ts index 6b82539..1901438 100644 --- a/src/push/dingtalk.ts +++ b/src/push/dingtalk.ts @@ -50,18 +50,18 @@ export type DingtalkOption = Partial<(Text | Markdown | Link | FeedCard | Action type TempDingtalkOption = { msgtype?: DingtalkOption['msgtype'] - text?: Text['text'] - markdown?: Markdown['markdown'] - link?: Link['link'] - actionCard?: { + text?: Partial + markdown?: Partial + link?: Partial + actionCard?: Partial<{ // 首屏会话透出的展示内容 title: string // markdown 格式的消息内容 text: string // 0:按钮竖直排列;1:按钮横向排列 btnOrientation?: '0' | '1' - } & Partial & Partial - feedCard?: FeedCard['feedCard'] + }> & Partial & Partial + feedCard?: Partial at?: Text['at'] [key: string]: any @@ -104,49 +104,35 @@ export const dingtalkOptionSchema: DingtalkOptionSchema = { title: '文本', description: '文本', required: false, - default: { - content: '', - }, + default: {}, }, markdown: { type: 'object', title: 'Markdown', description: 'Markdown', required: false, - default: { - title: '', - text: '', - }, + default: {}, }, link: { type: 'object', title: '链接', description: '链接', required: false, - default: { - text: '', - title: '', - messageUrl: '', - }, + default: {}, }, actionCard: { type: 'object', title: '动作卡片', description: '动作卡片', required: false, - default: { - title: '', - text: '', - }, + default: {}, }, feedCard: { type: 'object', title: '订阅卡片', description: '订阅卡片', required: false, - default: { - links: [], - }, + default: {}, }, } as const