首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apereo CAS HTML模板似乎没有加载

Apereo CAS HTML模板似乎没有加载
EN

Stack Overflow用户
提问于 2021-06-15 03:41:07
回答 1查看 734关注 0票数 1

因此,我使用cas-initializrcas文件夹中使用以下命令初始化CAS:

代码语言:javascript
复制
curl https://casinit.herokuapp.com/starter.tgz -d "dependencies=core,bootadmin,metrics,gitsvc,jsonsvc,redis,support-themes-core" | tar  -xzvf -

我的主题名字是example。以下是cas/src/main/resources/templates的文件结构

代码语言:javascript
复制
templates
├── META-INF
│   └── spring.factories
├── application.yml
├── example.properties
├── static
│   └── themes
│       └── example
│           ├── css
│           │   └── cas.css
│           ├── images
│           │   ├── favicon.ico
│           │   └── logo.png
│           └── js
│               └── cas.js
└── templates
    └── example
        └── casLoginView.html

casLoginView.html含量

代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Hello World!</h1>
</body>
</html>

example.properties含量

代码语言:javascript
复制
cas.theme.name=Example Theme
cas.theme.description=Example - Central Authentication Service

cas.standard.css.file=/themes/example/css/cas.css
cas.standard.js.file=/themes/example/js/cas.js
cas.logo.file=/themes/example/images/logo.png
cas.favicon.file=/themes/example/images/favicon.ico

cas.drawer-menu.enabled=false
cas.notifications-menu.enabled=false
cas.login-form.enabled=true

我的cas.properties文件位于/etc/cas/config/

代码语言:javascript
复制
cas.server.name=https://localhost:8443
cas.server.prefix=${cas.server.name}/cas

cas.serviceRegistry.json.location=file:/etc/cas/services
# cas.authn.accept.enabled=false

server.ssl.key-store=file:/etc/cas/thekeystore
server.ssl.key-store-password=changeit

cas.theme.defaultThemeName=example
spring.thymeleaf.cache=false

使用./gradlew bootRun启动服务器后,我在我的chrome浏览器上打开了https://localhost:8443/cas/login。CSS、Image和JS似乎加载得很好(我使用Chrome确认了它),但是默认的模板被使用而不是我的自定义模板。

我已经在谷歌上搜索了几个小时了,我仍然想不出如何让cas加载我的html模板。

P/s:我尝试将所有的resources内容都转移到cas/build/resourcescas/build/resources/main,但它似乎也不起作用。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-15 18:37:00

从6.4 RC5开始(这是您在撰写本文时运行的版本,应该在您最初的文章中提供此版本):

用户界面模板页的集合不再在web应用程序资源的上下文根中找到。相反,它们被组织并分组到每个功能类别的逻辑文件夹中。例如,处理登录或注销功能的页面现在可以在登录或注销目录中找到。页名本身仍未检查。您应该始终交叉检查模板位置和CAS WAR覆盖,并使用构建提供的工具从CAS web应用程序上下文中定位或获取模板。

https://apereo.github.io/cas/development/release_notes/RC5.html#thymeleaf-user-interface-pages

请阅读发行说明,并调整您的设置。

所有模板都在这里列出:https://apereo.github.io/cas/development/ux/User-Interface-Customization-Views.html#templates

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67979701

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档