Office js Word加载项身份验证对话框未关闭

Office js Word加载项身份验证对话框未关闭,office-js,word-addins,Office Js,Word Addins,如果需要显示对话框,则我的加载项对话框未在word中进行身份验证 我在office-login-callback.html中使用了此代码 页面已加载,并且其中存在有效令牌 如果我在excel中加载加载项,一切正常,但在Word中,对话框永远不会关闭 你知道我做错了什么吗,或者这是Word online的问题吗 <!DOCTYPE html> <html lang="en"> <head> <meta charset="

如果需要显示对话框,则我的加载项对话框未在word中进行身份验证

我在office-login-callback.html中使用了此代码 页面已加载,并且其中存在有效令牌

如果我在excel中加载加载项,一切正常,但在Word中,对话框永远不会关闭

你知道我做错了什么吗,或者这是Word online的问题吗

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
    <title>Validating your login...</title>
    <script type="text/javascript">
        var script = document.createElement('script');
        script.src = "https://appsforoffice.microsoft.com/lib/1.1/hosted/Office.js";
        script.type = "text/javascript";
        script.onload = function () {
            Office.onReady(async (info) => {
                console.log("Ready", info);
                if (/(access_token|code|error|state)/gi.test(location.href)) {
                    Office.context.ui.messageParent(JSON.stringify({ parse: false, value: location.href }));
                    console.log("that's all folks!");
                }
            });
        }
        document.getElementsByTagName('head')[0].appendChild(script);
    </script>

</head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root">Just checking your credentials...</div>
  </body>
</html>


正在验证您的登录。。。
var script=document.createElement('script');
script.src=”https://appsforoffice.microsoft.com/lib/1.1/hosted/Office.js";
script.type=“text/javascript”;
script.onload=函数(){
Office.onReady(异步(信息)=>{
控制台日志(“就绪”,信息);
if(/(访问令牌|代码|错误|状态)/gi.test(location.href)){
Office.context.ui.messageParent(JSON.stringify({parse:false,value:location.href}));
log(“这就是所有人!”);
}
});
}
document.getElementsByTagName('head')[0].appendChild(脚本);
您需要启用JavaScript才能运行此应用程序。
只是检查一下你的证件。。。
调用Office.onReady,并显示控制台日志“这就是所有人!”