首页 > 解决方案 > BotFramework-WebChat - 如何将自适应卡片的额外 URL 方案集列入白名单?

问题描述

我正在使用 Microsoft 的 BotFramework-WebChat 创建一个网络聊天,但我需要允许额外的一组 URL 方案用于卡片操作,而不仅仅是已经在 ALLOWED_SCHEMES 中设置的那些。

创建默认卡片操作的代码可以在这里找到:https ://github.com/microsoft/BotFramework-WebChat/blob/main/packages/component/src/Middleware/CardAction/createCoreMiddleware.js

建议实现卡片操作中间件来覆盖此行为(如您在此处看到的:https ://github.com/microsoft/BotFramework-WebChat/pull/3226 ),但我想做的只是添加一个/一些新的允许方案,我想知道是否可以通过在我的 App.js 中指定类似的内容来覆盖 createDefaultCardActionMiddleware 方法使用的这些允许的方案:

import createDefaultCardActionMiddleware from 'botframework-webchat-component/src/Middleware/CardAction/createCoreMiddleware';

    const cardActionMiddleware = (additional_schemes) => {
        //here I want to somehow add these new schemes to ALLOWED_SCHEMES that the below method uses
        createDefaultCardActionMiddleware(); 
    }

标签: reactjsbotframeworkweb-chat

解决方案


推荐阅读