feat: append logo url to cookie (#3507)

This commit is contained in:
DacongDA
2025-01-19 08:02:44 +08:00
committed by GitHub
parent 2b89f6b37b
commit a74a004540
2 changed files with 15 additions and 10 deletions

View File

@ -270,7 +270,7 @@ class App extends Component {
});
}
renderFooter() {
renderFooter(logo) {
return (
<React.Fragment>
{!this.state.account ? null : <div style={{display: "none"}} id="CasdoorApplicationName" value={this.state.account.signupApplication} />}
@ -288,7 +288,7 @@ class App extends Component {
: (
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={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 ?? this.state.logo} /></a>
</React.Fragment>
)
)
@ -362,11 +362,15 @@ class App extends Component {
renderPage() {
if (this.isDoorPages()) {
let themeData = this.state.themeData;
let logo = this.state.logo;
if (this.state.organization === undefined) {
const curCookie = Cookie.parse(document.cookie);
if (curCookie["organizationTheme"] && curCookie["organizationTheme"] !== "null") {
themeData = JSON.parse(curCookie["organizationTheme"]);
}
if (curCookie["organizationLogo"] && curCookie["organizationLogo"] !== "") {
logo = curCookie["organizationLogo"];
}
}
return (
@ -410,7 +414,7 @@ class App extends Component {
}
</Content>
{
this.renderFooter()
this.renderFooter(logo)
}
{
this.renderAiAssistant()