结合使用Microsoft Graph和javascript,应用程序无法在IE 11中运行

时间:2020-04-08 08:29:40

标签: javascript microsoft-graph-api msal

我想将Microsoft Graph API与javascript一起使用。我正在关注以下教程:

Microsoft Graph Javascript Tutorial Link

我已经按照上面的链接创建了演示应用程序。应用程序在Edge和Chrome浏览器中运行良好,但在IE 11中无法运行。 在IE 11中,我的代码出现以下错误:

IE浏览器错误屏幕截图:

enter image description here

IE在下面的代码行中给出错误:

const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider});

enter image description here

我需要修复在IE 11中不起作用的代码行:

const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider});

1 个答案:

答案 0 :(得分:0)

该行使用es6功能来简化对象中的属性分配。不幸的是,IE不支持es6,因此您可能需要将其重写为以下内容:

const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider: authProvider});

或使用Babel

这样的编译器