Skip to content

Commit

Permalink
增加语音识别逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashSoft committed May 17, 2019
1 parent 9d20bd1 commit bab5c31
Show file tree
Hide file tree
Showing 13 changed files with 1,774 additions and 171 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

# 对所有文件生效
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# 对后缀名为 md 的文件生效
[*.md]
trim_trailing_whitespace = false
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
"root": true,
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"extends": [
"vue", "plugin:vue/recommended"
],
"rules": {
"eqeqeq": 0,
"camelcase": 0,
"vue/html-self-closing": 0,
"vue/max-attributes-per-line": ["error", {
"singleline": 8,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": 0
}
}
4 changes: 4 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ typings/

# next.js build output
.next

test.*
.vscode
.DS_Store
Empty file modified LICENSE
100644 → 100755
Empty file.
61 changes: 2 additions & 59 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,5 @@

## 测试的NR流
```
[
{
"id": "7277f4f3.dbc25c",
"type": "bizwechat-output",
"z": "4a24f524.02204c",
"x": 490,
"y": 280,
"wires": []
},
{
"id": "71582f07.cdaac",
"type": "function",
"z": "4a24f524.02204c",
"name": "",
"func": "msg.payload = '我是NR的的消息'\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 320,
"y": 280,
"wires": [
[
"7277f4f3.dbc25c"
]
]
},
{
"id": "17ba7964.819c67",
"type": "debug",
"z": "4a24f524.02204c",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 320,
"y": 220,
"wires": []
},
{
"id": "5c971a6e.d36634",
"type": "bizwechat-input",
"z": "4a24f524.02204c",
"name": "",
"cropid": "",
"token": "",
"aeskey": "",
"port": "",
"x": 140,
"y": 280,
"wires": [
[
"71582f07.cdaac",
"17ba7964.819c67"
]
]
}
]
```
``
115 changes: 65 additions & 50 deletions bizwechat-configurator.html
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,72 +1,87 @@
<script type="text/javascript">
RED.nodes.registerType('bizwechat-configurator', {
category: 'config',
label() {
return this.name || '默认企业微信配置'
},
defaults: {
name: {
value: ''
},
port: {
value: '',
required: true
},
cropid: {
value: '',
required: true
},
agentid: {
value: '',
required: true
},
token: {
value: '',
required: true
},
corpsecret: {
value: '',
required: true
},
aeskey: {
value: '',
required: true
},

}
})
RED.nodes.registerType('bizwechat-configurator', {
category: 'config',
label () {
return this.name || '默认企业微信配置'
},
defaults: {
name: {
value: ''
},
port: {
value: '',
required: true
},
corpid: {
value: '',
required: true
},
agentid: {
value: '',
required: true
},
token: {
value: '',
required: true
},
corpsecret: {
value: '',
required: true
},
aeskey: {
value: '',
required: true
},
client_id:{
value:''
},
client_secret:{
value:''
}
}
})
</script>
<script type="text/x-red" data-template-name="bizwechat-configurator">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-tag"></i>名称</label>
<input type="text" id="node-config-input-name" placeholder="默认企业微信配置">
</div>
<div class="form-row">
<label for="node-config-input-port"><i></i>port</label>
<label for="node-config-input-port"><i></i>Port</label>
<input type="text" id="node-config-input-port" placeholder="本服务端口">
</div>
<div class="form-row">
<label for="node-config-input-cropid"><i></i>Cropid</label>
<input type="text" id="node-config-input-cropid" placeholder="企业ID">
<label for="node-config-input-corpid"><i></i>Corpid</label>
<input type="text" id="node-config-input-corpid" placeholder="微信企业ID">
</div>
<div class="form-row">
<label for="node-config-input-agentid"><i></i>Agentid</label>
<input type="text" id="node-config-input-agentid" placeholder="应用ID">
</div>
<label for="node-config-input-agentid"><i></i>Agentid</label>
<input type="text" id="node-config-input-agentid" placeholder="微信应用ID">
</div>
<div class="form-row">
<label for="node-config-input-corpsecret"><i></i>Secret</label>
<input type="text" id="node-config-input-corpsecret" placeholder="微信应用Secret">
</div>
<div class="form-row">
<label for="node-config-input-token"><i></i>Token</label>
<input type="text" id="node-config-input-token" placeholder="自建应用Token">
<input type="text" id="node-config-input-token" placeholder="微信应用回调Token">
</div>
<div class="form-row">
<label for="node-config-input-corpsecret"><i></i>Secret</label>
<input type="text" id="node-config-input-corpsecret" placeholder="自建应用Secret">
</div>
<label for="node-config-input-aeskey"><i></i>EncAESKey</label>
<input type="text" id="node-config-input-aeskey" placeholder="微信应用回调EncodingAESKey">
</div>
<div class="form-row">
<label for="node-config-input-aeskey"><i></i>AESKey</label>
<input type="text" id="node-config-input-aeskey" placeholder="自建应用EncodingAESKey">
<label style="width: 100%; text-align: center; color: #ccc;">以下内容为开启语音转文字时选填</label>
</div>
<div class="form-row">
<label for="node-config-input-client_id"><i></i>APIKey</label>
<input type="text" id="node-config-input-client_id" placeholder="百度语音应用API Key">
</div>
<div class="form-row">
<label for="node-config-input-client_secret"><i></i>SecretKey</label>
<input type="text" id="node-config-input-client_secret" placeholder="百度语音应用Secret Key">
</div>
</script>
<script type="text/x-red" data-help-name="bizwechat-configurator">


</script>
</script>
22 changes: 7 additions & 15 deletions bizwechat-configurator.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
module.exports = (RED) => {
function bizWechatConfiguratorNode(n) {
RED.nodes.createNode(this, n);

this.name = n.name;
this.port = n.port;
this.cropid = n.cropid;
this.agentid = n.agentid;
this.token = n.token;
this.corpsecret = n.corpsecret
this.aeskey = n.aeskey;

var node = this;
RED.nodes.registerType('bizwechat-configurator', class {
constructor (config) {
RED.nodes.createNode(this, config)
Object.assign(this, config)
// console.log('configurator config', config)
}

RED.nodes.registerType("bizwechat-configurator", bizWechatConfiguratorNode);
}
})
}
7 changes: 3 additions & 4 deletions bizwechat.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
bizwechat: {
value: '',
type: 'bizwechat-configurator'
},

}
},
inputs: 0,
outputs: 1,
Expand All @@ -35,7 +34,7 @@
value: '',
type: 'bizwechat-configurator'
},

},
inputs: 1,
outputs: 0,
Expand Down Expand Up @@ -67,4 +66,4 @@
</div>
</script>
<script type="text/x-red" data-help-name="bizwechat-output">
</script>
</script>
Loading

0 comments on commit bab5c31

Please sign in to comment.