【发布时间】:2019-07-16 06:09:07
【问题描述】:
我需要 Exchange 2013 帐户支持 Outlook Web 加载项。因此,在为 Outlook Web 应用添加清单文件后,加载项加载良好。
我正在使用对话框 API 弹出窗口来实现 登录 功能。所以当客户点击登录按钮时,它会显示Cannot read property 'displayDialogAsync' of undefined
在调试时,我发现 Office.context 不包含 ui 属性。
谁能指导我哪里出错了?或者包含交换帐户的 Outlook Web 应用是否支持此对话框 API。
我的加载项在 Outlook Desktop、Outlook Web 和 手机也是如此
if (window.hasOwnProperty('Office')) {
Office.context.ui.displayDialogAsync(
`${window.location.origin}/#/signin/` + Office.context.mailbox.userProfile.emailAddress,
{
height: 60,
width: 20
},
(result) => {
const dialog = result.value;
dialog.addEventHandler(
Office.EventType.DialogMessageReceived,
(e: { type: string, message: string }) => {
if (e.message === 'true') {
this.oAuthService.initImplicitFlow();
}
dialog.close();
});
}
);
}
【问题讨论】:
标签: outlook office-js outlook-web-addins outlook-web-app exchange-server-2013