问题描述
我的插件对话框如果需要显示对话框,则无法通过文字验证。
我在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>
将调用Office.onReady,并且控制台日志中的内容为“这就是所有人!”。显示。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)