无法在 Outlook 插件中设置测试许可证令牌

Can't set a test license token in an Outlook addin

我正在尝试在 Outlook 加载项中设置测试许可证令牌。根据文档,我必须在清单文件的 SourceLocation 中设置它:

<Form xsi:type="ItemRead">
  <DesktopSettings>
    <SourceLocation DefaultValue="https://localhost:3000?et=%3Cr%3E%0A%20%20%3..."/>
    <RequestedHeight>250</RequestedHeight>
  </DesktopSettings>
</Form>

问题是,当我尝试获取 URL 查询参数时,它不起作用。 window.location 看起来像这样:

https://localhost:3000/?et=

知道为什么会这样吗?

当我更新 Action ShowTaskpane 的源位置时,它不会启动插件:

<Action xsi:type="ShowTaskpane">
    <SourceLocation resid="messageReadTaskPaneUrl" />
</Action>

...

<bt:Url id="messageReadTaskPaneUrl" DefaultValue="https://localhost:3000?et=%3Cr%3E%0A%20%20%...">

如果我这样设置,当我启动插件时,它会显示:

Sorry, but we can't start this add-in because it isn't set up properly.

我使用以下测试令牌:

<r>
  <t 
    aid="WA907006056" 
    pid="{4FB601F2-5469-4542-B9FC-B96345DC8B39}" 
    cid="32F3E7FC559F4F49" 
    did="{0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1}" 
    ts="30" 
    et="Trial" 
    ad="2012-01-12T21:58:13Z" 
    ed="2019-06-30T21:58:13Z" 
    sd="2012-01-12T00:00:00Z"
    test="true" 
    te="2019-06-30T02:49:34Z" />
  <d>VNNAnf36IrkyUVZlihQJNdUUZl/YFEfJOeldWBtd3IM=</d>
</r>

并使用以下服务对 url 进行编码:

https://www.urlencoder.org/

问题出在 URL 编码上。编码令牌时,您必须删除所有新行。否则,它会抛出错误。所以,在编码之前,取token...

<r>
  <t 
    aid="WA907006056" 
    pid="{4FB601F2-5469-4542-B9FC-B96345DC8B39}" 
    cid="32F3E7FC559F4F49" 
    did="{0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1}" 
    ts="30" 
    et="Trial" 
    ad="2012-01-12T21:58:13Z" 
    ed="2019-06-30T21:58:13Z" 
    sd="2012-01-12T00:00:00Z"
    test="true" 
    te="2019-06-30T02:49:34Z" />
  <d>VNNAnf36IrkyUVZlihQJNdUUZl/YFEfJOeldWBtd3IM=</d>
</r>

并像这样删除所有新行:

<r> <t aid="WA907006056" pid="{4FB601F2-5469-4542-B9FC-B96345DC8B39}" cid="32F3E7FC559F4F49" did="{0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1}" ts="30" et="Trial" ad="2012-01-12T21:58:13Z" ed="2019-06-30T21:58:13Z" sd="2012-01-12T00:00:00Z" test="true" te="2019-06-30T02:49:34Z" /> <d>VNNAnf36IrkyUVZlihQJNdUUZl/YFEfJOeldWBtd3IM=</d> </r>

最后对其进行编码并添加到所有源位置。