UNPKG

node-red-contrib-feishu

Version:

Node-RED节点用于发送飞书消息

84 lines (76 loc) 3.65 kB
<!-- 节点类型注册脚本 --> <script type="text/javascript"> // 注册名为'aliyun-sms'的节点类型 RED.nodes.registerType('aliyun-sms',{ category: 'social', // 节点分类:社交类 color: '#FF6A00', // 节点颜色 defaults: { // 默认配置项 name: {value:""}, // 节点名称,可选 smsConfig: {value:"", type: "aliyun-sms-config", required: true}, // 阿里云配置,必填 templateCode: {value:"", required: true}, // 短信模板CODE,必填 signName: {value:"", required: true} // 短信签名,必填 }, inputs:1, // 输入连接点数量 outputs:1, // 输出连接点数量 icon: "font-awesome/fa-comments", // 节点图标 label: function() { // 节点标签显示函数 return this.name||"阿里云短信"; }, paletteLabel: "阿里云短信" // 面板中显示的节点名称 }); </script> <!-- 节点配置界面模板 --> <script type="text/html" data-template-name="aliyun-sms"> <!-- 节点名称配置 --> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> 名称</label> <input type="text" id="node-input-name" placeholder="名称"> </div> <!-- 阿里云配置 --> <div class="form-row"> <label for="node-input-smsConfig"><i class="fa fa-gear"></i> 阿里云配置</label> <input type="text" id="node-input-smsConfig"> </div> <!-- 短信模板CODE --> <div class="form-row"> <label for="node-input-templateCode"><i class="fa fa-file-text-o"></i> 模板CODE</label> <input type="text" id="node-input-templateCode" placeholder="短信模板CODE"> </div> <!-- 短信签名 --> <div class="form-row"> <label for="node-input-signName"><i class="fa fa-pencil"></i> 短信签名</label> <input type="text" id="node-input-signName" placeholder="短信签名"> </div> </script> <!-- 节点帮助文档 --> <script type="text/html" data-help-name="aliyun-sms"> <!-- 节点功能简介 --> <p>发送阿里云短信</p> <!-- 输入参数说明 --> <h3>输入</h3> <dl class="message-properties"> <!-- 必填参数:手机号码 --> <dt>phoneNumber <span class="property-type">string | array</span></dt> <dd>接收短信的手机号码,可以是单个号码或号码数组</dd> <!-- 必填参数:模板参数 --> <dt>templateParam <span class="property-type">object</span></dt> <dd>短信模板参数,需要与模板中的变量名一一对应的JSON对象</dd> <!-- 可选参数:上行短信扩展码 --> <dt class="optional">smsUpExtendCode <span class="property-type">string</span></dt> <dd>上行短信扩展码,可选参数</dd> <!-- 可选参数:外部流水扩展字段 --> <dt class="optional">outId <span class="property-type">string</span></dt> <dd>外部流水扩展字段</dd> </dl> <!-- 输出参数说明 --> <h3>输出</h3> <dl class="message-properties"> <dt>payload <span class="property-type">object</span></dt> <dd>短信发送结果</dd> </dl> <!-- 详细使用说明 --> <h3>详细信息</h3> <p>该节点用于发送阿里云短信,支持单发和群发功能。</p> <p>使用前需要在阿里云配置中设置正确的AccessKey ID和AccessKey Secret。</p> <p>模板参数需要与阿里云短信模板中定义的变量名保持一致。</p> </script>