MS Teams:我们无法保存您的选项卡设置。请再试一次

MS Teams : We couldn't save your tab settings. Please try again

我正在尝试在 Teams 中添加一个配置选项卡,如 https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/tabs/tabs-configuration 所示,但我收到错误消息,因为我们无法保存您的选项卡设置。请重试。

下面是Javascript

<script type="text/javascript">
microsoftTeams.initialize();
microsoftTeams.settings.registerOnSaveHandler(function (saveEvent) {
var radios = document.getElementsByName("maptype");
if (radios[0].checked) {
   microsoftTeams.settings.setSettings({
     entityId: "bing",
     contentUrl: "https://www.bing.com/maps/embed",
     suggestedDisplayName: "Bing Map",
     websiteUrl: "https://www.bing.com/maps",
     removeUrl: "https://teams-get-started-sample.azurewebsites.net/tabremove.html",
  });
}
else {
   microsoftTeams.settings.setSettings({
     entityId: "google",
     contentUrl: "https://www.google.com/maps/embed",
     suggestedDisplayName: "Google Map",
     websiteUrl: "https://www.google.com/maps",
     removeUrl: "https://teams-get-started-sample.azurewebsites.net/tabremove.html",
  });
}

saveEvent.notifySuccess();
});

function onClick() {
microsoftTeams.settings.setValidityState(true);
}
</script>

Here is the Error image in MS Teams

正如@Wajeed-MSTF 建议的那样,添加有效域解决了我的问题。谢谢!

 "validDomains": [ "static2.sharepointonline.com", "secure.aadcdn.microsoftonline-p.com", "code.jquery.com", "statics.teams.microsoft.com", ".microsoftonline.com", "ajax.googleapis.com", ".bing.com", "*.google.com" ]