我想托管或嵌入一个Azure Web聊天机器人在现有的web应用程序中使用客户端的Web聊天控件。用户必须先登录到web应用程序,才能在web应用程序中使用web聊天机器人功能。
如果我有一个已经登录到我的web应用程序的用户,我可以使用什么机制将该用户传递给网络聊天控制JavaScript?
我正在检查示例这里,嵌入web聊天的源代码如下所示:
<!DOCTYPE html>
<html>
<body>
<div id="webchat" role="main"></div>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<script>
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({ token: 'YOUR_DIRECT_LINE_TOKEN' }),
userID: 'YOUR_USER_ID',
username: 'Web Chat User',
locale: 'en-US',
botAvatarInitials: 'WC',
userAvatarInitials: 'WW'
}, document.getElementById('webchat'));
</script>
</body>
</html>因此,这是否意味着我必须生成或获取loggedin用户ID和名称,并将其传递给用户名和userID,用于web应用程序上的每个新用户会话?
https://stackoverflow.com/questions/54964685
复制相似问题