【发布时间】:2020-09-11 09:58:34
【问题描述】:
我第一次将 createdirectline 中的令牌初始化到服务器时保存了它。但是每当我从服务器获取令牌并使用它时,它不会使用该令牌,而是会创建一个新令牌。
React.useEffect(() => {
const temp = async () => {
if (Object.entries(directline).length === 0) {
if(await props.chatBotData!.tokenFromDb){
setDirectline(createDirectLine({ token: props.chatBotData.tokenFromDb.toString() }));
}else {
setDirectline(createDirectLine({ token: DIRECTLINE_SECRET }));
}
}
};
temp();
}, [directline,props.chatBotData]);
const [directline, setDirectline]: any = useState({});
【问题讨论】:
-
接受/投票支持更大的 Stack Overflow 社区和任何有类似问题的人。如果您觉得我的回答足够,请“接受”并点赞。如果没有,请告诉我我还能提供哪些帮助!
标签: reactjs botframework direct-line-botframework