Office js Outlook Web加载项无法读取属性';版本';outlook-web-16.01.js中的空值
我正在尝试从Outlook Web加载项实现调用OneDrive Api 我使用下面的代码获取访问令牌Office js Outlook Web加载项无法读取属性';版本';outlook-web-16.01.js中的空值,office-js,outlook-web-addins,Office Js,Outlook Web Addins,我正在尝试从Outlook Web加载项实现调用OneDrive Api 我使用下面的代码获取访问令牌 function initializePane() { // First attempt to get an SSO token if (Office.context.auth !== undefined && Office.context.auth.getAccessTokenAsync !== undefined) { Office.cont
function initializePane() {
// First attempt to get an SSO token
if (Office.context.auth !== undefined && Office.context.auth.getAccessTokenAsync !== undefined) {
Office.context.auth.getAccessTokenAsync(function (result) {
if (result.status === "succeeded") {
// No need to prompt user, use this token to call Web API
saveAttachmentsWithSSO(result.value, 1);
} else if (result.error.code == 13007 || result.error.code == 13005) {
// These error codes indicate that we need to prompt for consent
Office.context.auth.getAccessTokenAsync({ forceConsent: true }, function (result) {
if (result.status === "succeeded") {
saveAttachmentsWithSSO(result.value, 1);
} else {
// Could not get SSO token, proceed with authentication prompt
saveAttachmentsWithPrompt(1);
}
});
} else {
// Could not get SSO token, proceed with authentication prompt
saveAttachmentsWithPrompt(123);
}
});
}
else {
// SSO not supported
saveAttachmentsWithPrompt(1);
}
}
错误发生在此行Office.context.auth.getAccessTokenAsync
未捕获的TypeError:无法读取null的属性“Version”
在Object.callback(outlook-web-16.01.js:16)
在rt(outlook-web-16.01.js:16)
(匿名)@outlook-web-16.01.js:16
rt@outlook-web-16.01.js:16
似乎是一个类似的问题。你能看一下这个,看看它是否有用吗。@OutlookAdd insTeam MSFT链接不起作用,它没有告诉我们工作和非工作清单之间的区别。您能告诉我如何根据答案进行更改吗?您使用的是哪个平台:旧OWA还是新OWA(出现在右角的选项:尝试新outlook)?