script里直接粘贴卡片模板代码总是出现error: Can't compile script: [Error: was expecting type: java.util.LinkedHashMap; but found type: java.util.Map] [Near : {... }; ....}] ^ [Line: 30, Column: 3] 3] 要怎么改呀 下面是删减了一些的代码(无论是完整的示例代码还是下面这个简洁的代码都有error) var newMsg = { "msgtype":"template_card", "template_card":{ "card_type":"text_notice", "main_title":{ "title":"欢迎使用企业微信", "desc":"您的好友正在邀请您加入企业微信" }, "sub_title_text":"下载企业微信还能抢红包!", "horizontal_content_list":[ { "keyname":"企微官网" }, { "keyname":"企微下载" } ], "jump_list":[ { "title":"企业微信官网" }, { "title":"跳转小程序" } ], "card_action":{ "type":1 } } }; return { msg: newMsg };
企微群机器人发送图文卡片消息不能设置card_action为0企微群机器人发送图文卡片消息不能设置card_action为0。 说明里说card_action.type Int 跳转事件类型,0或不填代表不是链接,1 代表跳转url,2 代表打开小程序 实际测试填0会异常 AssertionError: b'{"errcode":42045,"errmsg":"Template_Card card_action Missing or Invalid, hint: [1631786729_238_0ce7c80781f65a8aba97ac1741a9d57e], from ip: 121.10.41.102, more info at https://open.work.weixin.qq.com/devtool/query?e=42045"}' { "msgtype": "template_card", "template_card": { "card_type": "news_notice", "source": { "icon_url": "", "desc": "" }, "main_title": { "title": "main_title__title", "desc": "main_title__desc" }, "card_image": { "url": "1", "aspect_ratio": 2.25 }, "vertical_content_list": [], "horizontal_content_list": [], "jump_list": [], "card_action": { "type": 0, "url": "", "appid": "", "pagepath": "" } } })
03-06