【发布时间】:2019-09-11 10:59:39
【问题描述】:
我在 webchat 中输入密码时遇到问题。我使用 Sample - Customize Web Chat with Password Input Activity 用于密码输入卡,当我输入错误密码时,它会显示一条消息,例如密码错误,请重试,但是当我输入密码时表单我需要显示另一条消息。
我使用了这个代码。
if (card.activity.type === 'message') {
if (
card.activity.from.role === 'bot' &&
(card.activity.text === getLoginMessage(this.props.language) ||
card.activity.text === getLoginRetryMessage(this.props.language))
) {
let message = card.activity.text;
if (!this.hasSubmittedPassword && (card.activity.text === getLoginRetryMessage(this.props.language))) {
message = "Please fill the form and click enter in order to complete your request.";
}
return children => (
<ConnectedPasswordInputActivity
promptMessage={message}
passwordPlaceholder={this.props.literals.password}
language={this.props.language}
handlePasswordSubmit={this.handlePasswordSubmit}
>
{next(card)(children)}
</ConnectedPasswordInputActivity>
);
}
【问题讨论】:
-
接受/投票支持更大的 Stack Overflow 社区和任何有类似问题的人。如果您觉得我的回答足够,请“接受”并点赞。如果没有,请告诉我我还能提供哪些帮助
标签: botframework web-chat