我正在尝试在小组中添加配置标签,如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>
答案 0 :(得分:0)
正如@ 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" ]