c# - 任务模块显示具有 validDomain 的空白团队
问题描述
所以我在我的机器人框架上发送了一张带有提交动作的自适应卡片,提交动作调用了动作。当 TaskModuleContinueResponse 设置为 card 时,任务模块工作正常,但是当我将我的 NRGROK URL 用于 TaskModuleContinueResponse 时,它只会显示空白。我已经在有效域中添加了我的 NGROK URL,当我看到 NGROK 检查时,我没有看到我的页面被调用。这是我的清单
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"manifestVersion": "1.9",
"version": "1.0.0",
"id": "1c07cd26-a088-4db8-8928-ace382fa219f",
"packageName": "Some.microsoft.teams.companycommunicator.authors",
"developer": {
"name": "Some",
"websiteUrl": "https://somewebsite.com",
"privacyUrl": "https://somewebsite.com",
"termsOfUseUrl": "https://somewebsite.com"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Announce (Authors)",
"full": "Company Announce (Authors)"
},
"description": {
"short": "Broadcast messages to multiple teams and people in one go",
"full": "Broadcasts messages to multiple teams and individuals through channel posts and chat messages"
},
"accentColor": "#64A2CC",
"configurableTabs": [
{
"configurationUrl": "https://b0837b7151f7.ngrok.io/configtab",
"canUpdateConfiguration": true,
"scopes": [
"team"
],
"context": [
"channelTab"
]
}
],
"bots": [
{
"botId": "eae687a6-936c-4fd7-ade7-1f01b388ac16",
"scopes": [
"team"
],
"commandLists": [
{
"scopes": [
"team"
],
"commands": [
{
"title": "Test",
"description": "Test bot trigger"
}
]
}
],
"supportsFiles": true,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"b0837b7151f7.ngrok.io",
],
"webApplicationInfo": {
"id": "eae687a6-936c-4fd7-ade7-1f01b388ac16",
"resource": "api://b0837b7151f7.ngrok.io"
}
}
这是我使用 ASP Net core 的任务模块的代码
protected override async Task<TaskModuleResponse> OnTeamsTaskModuleFetchAsync(ITurnContext<IInvokeActivity> turnContext, TaskModuleRequest taskModuleRequest, CancellationToken cancellationToken)
{
var reply = MessageFactory.Text("OnTeamsTaskModuleFetchAsync TaskModuleRequest: " + JsonConvert.SerializeObject(taskModuleRequest));
await turnContext.SendActivityAsync(reply);
return new TaskModuleResponse
{
Task = new TaskModuleContinueResponse
{
Value = new Microsoft.Bot.Schema.Teams.TaskModuleTaskInfo()
{
//Card = CreateAdaptiveCardAttachment(),
Url = "https://b0837b7151f7.ngrok.io/details",
FallbackUrl = "https://b0837b7151f7.ngrok.io/details",
Height = 800,
Width = 1000,
Title = "Details",
},
},
};
}
而我的页面只是简单的hello world。
import React, { Component } from 'react'
import * as microsoftTeams from "@microsoft/teams-js";
export default class SeeDetail extends Component {
componentDidMount() {
microsoftTeams.initialize();
}
render() {
return (
<div>
<center>
<h1>Hello World</h1>
</center>
</div>
)
}
}
我不知道为什么喜欢它被阻止或其他什么,因为我在 NGROK Inspect 上没有看到对我的页面的任何请求。这里有什么遗漏吗
解决方案
我已经尝试过使用您的代码,它可以正常工作。
https://b0837b7151f7.ngrok.io/details
当您调用 using并尝试通过生成新的 ngrok Url 来呈现页面时,请在浏览器中检查您的反应页面是否在浏览器中正确呈现。
还可以通过在任务模块工作示例中添加您的反应页面 url 来检查。
如果问题仍然存在,请尝试删除现有应用并在团队应用工作室中再次上传您的清单。
推荐阅读
- python - 如何在 discord.py 中获取权限对象的所有权限 ID
- postgresql - 使用 copy_from 在大型数据集中复制,使用临时表执行 ON CONFLICT,CardinalityViolation?
- apache-spark - Spark的最后几个任务挂起并且进展非常缓慢
- c - 按下修饰键时获取修改后的键码(字符)
- typescript - 使用扩展语法应用更新时如何处理空/未定义属性?
- webpack - 为什么迁移到 Webpack 5 后 Karma 测试会失败?
- vba - 如何从动态起点填写选择?
- tomcat - 未找到允许使用 OpenSSL 的 Apache Tomcat Native 库
- node.js - 将 JSON 从前端发送到后端的正确方法是什么?
- javascript - 在 D3.js 中透视数据