如何更改 Broadleaf 中的管理员徽标

How to Change the Admin logo in Broadleaf

您好,请帮助更改 broad-leaf 中的管理徽标。以及图像和模板在管理员中的位置。我已经完成了文件结构的搜索,但我不会在那里找到图像文件夹。请帮助解决问题提前谢谢。

管理模板已打包。例如,就我而言,他们在这里:

C:\Users\myuser\.m2\repository\org\broadleafcommerce\broadleaf-open-admin-platform.2.0-SNAPSHOT\broadleaf-open-admin-platform-5.2.0-20170707.134303-195.jar!\open_admin_style

您将必须按照我在上面提到的目录中找到的相同文件夹结构覆盖管理模板,但在 /src/resources 下复制到您的管理项目中。

例如,您可以将修改后的 loginLayout.html 放在这里:

admin\src\main\resources\open_admin_style\templates\layout\

您的 loginLayout.html 可以包含 /img/admin/your-company-logo.png ,并将徽标放在此处:

admin\src\main\resources\open_admin_style\img\admin\your-company-logo.png

编辑:我可能是错的,但在这个简单的覆盖案例中使用相似的文件名可能很重要。

您还需要更改 AdminSecurityConfig.java 中的配置以启用“/open_admin_style/img/**”

 @Override
    public void configure(WebSecurity web) throws Exception {
        web
            .ignoring()
            .antMatchers("/**/*.css")
            .antMatchers("/**/*.js")
            .antMatchers("/open_admin_style/img/") // <-------
            .antMatchers("/img/**")
            .antMatchers("/fonts/**")
            .antMatchers("/**/"+assetServerUrlPrefixInternal+"/**")
            .antMatchers("/favicon.ico")
            .antMatchers("/robots.txt");
    }