feat: add wehchat template message push
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// config.js
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'prod';
|
||||
|
||||
const config = {
|
||||
apiUrl: isProduction ? '' : 'http://localhost:8000',
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -84,6 +84,25 @@ const CONSTANT = {
|
||||
taskInsInputs: [
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'WeChatOFAccount',
|
||||
label: '微信测试公众号模板消息',
|
||||
inputs: [
|
||||
{ subLabel: 'appID', value: '', col: 'appID', desc: "公众号appid" },
|
||||
{ subLabel: 'appsecret', value: '', col: 'appsecret', desc: "公众号appsecret" },
|
||||
{ subLabel: '模板id', value: '', col: 'tempid', desc: "模板消息id" },
|
||||
{ subLabel: '渠道名', value: '', col: 'name', desc: "想要设置的渠道名字" },
|
||||
],
|
||||
tips: {
|
||||
text: "公众号消息说明", desc: "微信测试公众号模板消息发送,token使用内存缓存,<br />秘钥请访问 https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index"
|
||||
},
|
||||
taskInsRadios: [
|
||||
{ subLabel: 'text', content: 'text' },
|
||||
],
|
||||
taskInsInputs: [
|
||||
{ value: '', col: 'to_account', desc: "要发送的OpenId(登录微信公众号后台查看)" },
|
||||
],
|
||||
},
|
||||
],
|
||||
API_VIEW_DATA: [
|
||||
{ label: "curl", class: "language-shell line-numbers", code: "", func: ApiStrGenerate.getCurlString },
|
||||
|
||||
@@ -16,6 +16,9 @@ class ApiStrGenerate {
|
||||
if (options.markdown) {
|
||||
data.markdown = '**Hello World!**';
|
||||
}
|
||||
if (options.url) {
|
||||
data.url = 'https://github.com';
|
||||
}
|
||||
let dataStr = JSON.stringify(data, null, 4);
|
||||
return dataStr
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
<template #content>
|
||||
一个任务可能关联多个不同渠道的实例
|
||||
<br />
|
||||
实例的内容类型大体上可以可以分为text、html、markdown
|
||||
实例的内容类型大体上可以可以分为text、html、markdown
|
||||
<br />
|
||||
微信测试公众号需要额外传递url字段,可以跳转到消息的详情地址
|
||||
<br />
|
||||
发送的消息会优先选择相应的类型消息进行发送,如果没有,将使用传的text消息进行发送
|
||||
<br />
|
||||
@@ -84,6 +86,9 @@ export default defineComponent({
|
||||
let viewOptions = {}
|
||||
insTableData.forEach(element => {
|
||||
viewOptions[element.content_type] = 1;
|
||||
if (element.way_type == "WeChatOFAccount") {
|
||||
viewOptions['url'] = 1;
|
||||
}
|
||||
});
|
||||
return viewOptions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user