我有一个用SDK4开发并部署在IIS中的机器人。当我使用secret与网络聊天集成时,它起作用了。
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({
secret: 'SECRET CODE'
}),
// Passing 'styleOptions' when rendering Web Chat
styleOptions
},
document.getElementById('webchat')
);
但在上述情况下,它的样式选项非常有限。我想使用REACT,它需要令牌交换。我不确定这将如何使用?意思是在客户端和Bot端需要做哪些修改?我找不到任何关于这方面的描述性文档。如果我们可以在客户端和机器人端为令牌交换的更改进行采样,那就太好了。
发布于 2019-11-21 17:56:57
你可以使用REACT来设计你的网络聊天。僵尸框架-webchat repo here提供了一些示例和示例来说明这一点。对于令牌交换,您需要使用以下内容:
import { DirectLine } from 'botframework-directlinejs';
import React from 'react';
import ReactWebChat from 'botframework-webchat';
export default class extends React.Component {
constructor(props) {
super(props);
this.directLine = new DirectLine({ token: 'YOUR_DIRECT_LINE_TOKEN' });
}
render() {
return (
<ReactWebChat directLine={ this.directLine } userID='YOUR_USER_ID' />
element
);
}
}
https://stackoverflow.com/questions/58973575
复制相似问题