问题描述
正如微软官方文档中所述,我在我的 html 页面上添加了“共享到团队”按钮,但在打开的弹出窗口中,它给出了错误
那么如何对用户进行身份验证,我们是否必须为此或其他任何东西调用另一个API....
当我搜索时,我发现了 Graph API,但不知道这是我需要的还是如何使用它。
我已经创建了这个简单的 html 页面。
HTML 代码
<html>
<head>
<title>Hello Teams</title>
<script async defer src="https://teams.microsoft.com/share/launcher.js"></script>
</head>
<body>
<h1>Share to Teams</h1>
<p>Please click on this icon below</p>
<span
class="teams-share-button"
data-icon-px-size="64"
data-href="https://docs.microsoft.com/en-us/graph/teams-concept-overview"
data-preview="false"
data-msg-text="Hello Avengers"
data-assign-title="Demo Share"
data-assign-instr="Demo Default Assignment Instructions"></span>
</body>
</html>
解决方法
当我在隐身窗口中打开共享到团队按钮 html 文件时,我能够重现您的问题。
我已针对此问题提出了一个错误,相关团队正在解决此问题。
或者,您可以使用下面的代码并请through 这个。
<div class="teams-share-button" data-href="https://docs.microsoft.com">
<a target="ms-teams-share-popup" onclick="window.open('https://teams.microsoft.com/share?href=https%3A%2F%2Fdocs.microsoft.com&referrer=docs.microsoft.com','ms-teams-share-popup','width=700,height=600'); return false" href="https://teams.microsoft.com/share?href=https%3A%2F%2Fdocs.microsoft.com&referrer=docs.microsoft.com">
<img alt="Share to Microsoft Teams" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...Zz4=" width="32" height="32">
</a>
</div>