feat: append footerHtml to cookie (#3508)

This commit is contained in:
DacongDA
2025-01-19 23:34:43 +08:00
committed by GitHub
parent a74a004540
commit 49dda2aea5
2 changed files with 19 additions and 12 deletions

View File

@ -270,7 +270,9 @@ class App extends Component {
});
}
renderFooter(logo) {
renderFooter(logo, footerHtml) {
logo = logo ?? this.state.logo;
footerHtml = footerHtml ?? this.state.application?.footerHtml;
return (
<React.Fragment>
{!this.state.account ? null : <div style={{display: "none"}} id="CasdoorApplicationName" value={this.state.account.signupApplication} />}
@ -281,14 +283,14 @@ class App extends Component {
}
}>
{
this.state.application?.footerHtml && this.state.application.footerHtml !== "" ?
footerHtml && footerHtml !== "" ?
<React.Fragment>
<div dangerouslySetInnerHTML={{__html: this.state.application.footerHtml}} />
<div dangerouslySetInnerHTML={{__html: footerHtml}} />logo
</React.Fragment>
: (
Conf.CustomFooter !== null ? Conf.CustomFooter : (
<React.Fragment>
Powered by <a target="_blank" href="https://casdoor.org" rel="noreferrer"><img style={{paddingBottom: "3px"}} height={"20px"} alt={"Casdoor"} src={logo ?? this.state.logo} /></a>
Powered by <a target="_blank" href="https://casdoor.org" rel="noreferrer"><img style={{paddingBottom: "3px"}} height={"20px"} alt={"Casdoor"} src={logo} /></a>
</React.Fragment>
)
)
@ -363,6 +365,7 @@ class App extends Component {
if (this.isDoorPages()) {
let themeData = this.state.themeData;
let logo = this.state.logo;
let footerHtml = null;
if (this.state.organization === undefined) {
const curCookie = Cookie.parse(document.cookie);
if (curCookie["organizationTheme"] && curCookie["organizationTheme"] !== "null") {
@ -371,6 +374,9 @@ class App extends Component {
if (curCookie["organizationLogo"] && curCookie["organizationLogo"] !== "") {
logo = curCookie["organizationLogo"];
}
if (curCookie["organizationFootHtml"] && curCookie["organizationFootHtml"] !== "") {
footerHtml = curCookie["organizationFootHtml"];
}
}
return (
@ -414,7 +420,7 @@ class App extends Component {
}
</Content>
{
this.renderFooter(logo)
this.renderFooter(logo, footerHtml)
}
{
this.renderAiAssistant()