Commit 4e97b32e authored by 以墨为白's avatar 以墨为白 🎧

新技术

parent ec54df06
......@@ -77,16 +77,15 @@ export default {
this.stompClient && this.stompClient.connected && this.stompClient.disconnect();
this.stompClient = Stomp.over(this.ws);
this.stompClient.heartbeat.outgoing = 20000; //若使用STOMP 1.1 版本,默认开启了心跳检测机制(默认值都是10000ms)
this.stompClient.heartbeat.incoming = 20000; //客户端从服务端接收心跳包
this.stompClient.heartbeat.incoming = 20000; //客户端从服务端接收心跳包
this.stompClient.debug = null;
this.stompClient.connect({ name: this.userInfo.account }, frame => {
this.stompClient.connect({ name: this.userInfo.account , token: sessionStorage.getItem("token")}, frame => {
// resolve("连接成功")
}, err => {
console.log(typeof err == "string" ? err : err.headers.message)
console.log(new Date().toLocaleTimeString() + (typeof err == "string" ? err : err.headers.message))
reject(typeof err == "string" ? err : err.headers.message)
});
})
});
},
reconnect(){
if (this._lockReconnect) return;
......
......@@ -56,7 +56,7 @@ export default {
if (this.form.technique == 1) {
if (this.form.text.trim() != '') {
entity({ action: "entity_extract", language: "zh", text: this.form.text.trim() }).then(res => {
this.form.result = res.score;
this.form.result = res.map(e=>e.entity_list.map(a=>a.entity_name).join()).filter(b=>b.length).join();
}).catch(err=>{
this.$message.warning(err.message);
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment