钉钉开发之PC端钉钉打开微应用为空白页问题

来源:互联网 发布:英雄联盟关注软件 编辑:程序博客网 时间:2024/05/15 05:44

在实现开发的h5页面的微应用在PC端打开时遇到了一个问题,PC端的钉钉是采用iframe引入H5页面的,我使用了spring-security,由于在spring-security默认的x-frame-options是DENY(禁止iframe引入页面)的,所以导致在pc端无法引入H5页面。

解决方法:
在spring-security策略中添加如下代码即可解决:

        <sec:http auto-config="true" use-expressions="true">        <sec:headers>              <sec:frame-options policy="ALLOW-FROM" strategy="static" value="app://desktop.dingtalk.com"/>        </sec:headers>        </sec:http>