检测 Office365 与 outlook.com 的上下文

Detecting the context for Office365 vs outlook.com

检测 outlook.com 和 Office365 帐户上下文差异的正确方法是什么?我希望为每种帐户类型提供一些不同的体验,但我不确定什么是正确的方法。一个潜在的解决方案是检查电子邮件地址和扩展名,但我正在寻找一种更优雅的(通过代码如: Office.context.isO365() )解决它的方法。

请使用Office.context.mailbox.userProfile.accountType

https://docs.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/requirement-set-1.6/office.context.mailbox.userprofile#accounttype-string