feat: use StaticBaseUrl in frontend

This commit is contained in:
Yang Luo 2025-03-26 21:32:23 +08:00
parent 5417a90223
commit 4bee21f4a3
5 changed files with 9 additions and 9 deletions

View File

@ -86,11 +86,11 @@ const sideTemplate = `<style>
} }
</style> </style>
<div class="left-model"> <div class="left-model">
<span class="side-logo"> <img src="https://cdn.casbin.org/img/casdoor-logo_1185x256.png" alt="Casdoor" style="width: 120px"> <span class="side-logo"> <img src="${Setting.StaticBaseUrl}/img/casdoor-logo_1185x256.png" alt="Casdoor" style="width: 120px">
<span>SSO</span> <span>SSO</span>
</span> </span>
<div class="img"> <div class="img">
<img src="https://cdn.casbin.org/img/casbin.svg" alt="Casdoor"/> <img src="${Setting.StaticBaseUrl}/img/casbin.svg" alt="Casdoor"/>
</div> </div>
</div> </div>
`; `;

View File

@ -1532,7 +1532,7 @@ export function getUserCommonFields() {
} }
export function getDefaultFooterContent() { export function getDefaultFooterContent() {
return "Powered by <a target=\"_blank\" href=\"https://casdoor.org\" rel=\"noreferrer\"><img style=\"padding-bottom: 3px\" height=\"20\" alt=\"Casdoor\" src=\"https://cdn.casbin.org/img/casdoor-logo_1185x256.png\"/></a>"; return `Powered by <a target="_blank" href="https://casdoor.org" rel="noreferrer"><img style="padding-bottom: 3px" height="20" alt="Casdoor" src="${StaticBaseUrl}/img/casdoor-logo_1185x256.png"/></a>`;
} }
export function getEmptyFooterContent() { export function getEmptyFooterContent() {
@ -1564,7 +1564,7 @@ export function getDefaultHtmlEmailContent() {
<div class="email-container"> <div class="email-container">
<div class="header"> <div class="header">
<h3>Casbin Organization</h3> <h3>Casbin Organization</h3>
<img src="https://cdn.casbin.org/img/casdoor-logo_1185x256.png" alt="Casdoor Logo" width="300"> <img src="${StaticBaseUrl}/img/casdoor-logo_1185x256.png" alt="Casdoor Logo" width="300">
</div> </div>
<p><strong>%{user.friendlyName}</strong>, here is your verification code</p> <p><strong>%{user.friendlyName}</strong>, here is your verification code</p>
<p>Use this code for your transaction. It's valid for 5 minutes</p> <p>Use this code for your transaction. It's valid for 5 minutes</p>

View File

@ -1,4 +1,5 @@
import React from "react"; import React from "react";
import * as Setting from "./Setting";
export const TourObj = { export const TourObj = {
home: [ home: [
@ -8,7 +9,7 @@ export const TourObj = {
cover: ( cover: (
<img <img
alt="casdoor.png" alt="casdoor.png"
src="https://cdn.casbin.org/img/casdoor-logo_1185x256.png" src={`${Setting.StaticBaseUrl}/img/casdoor-logo_1185x256.png`}
/> />
), ),
}, },

View File

@ -37,7 +37,6 @@ const FaceRecognitionModal = (props) => {
const loadModels = async() => { const loadModels = async() => {
// const MODEL_URL = process.env.PUBLIC_URL + "/models"; // const MODEL_URL = process.env.PUBLIC_URL + "/models";
// const MODEL_URL = "https://justadudewhohacks.github.io/face-api.js/models"; // const MODEL_URL = "https://justadudewhohacks.github.io/face-api.js/models";
// const MODEL_URL = "https://cdn.casbin.org/site/casdoor/models";
const MODEL_URL = "https://cdn.casdoor.com/casdoor/models"; const MODEL_URL = "https://cdn.casdoor.com/casdoor/models";
Promise.all([ Promise.all([

View File

@ -137,10 +137,10 @@ class MfaAccountTable extends React.Component {
render: (text, record, index) => ( render: (text, record, index) => (
<Tooltip> <Tooltip>
{text ? ( {text ? (
<Image width={36} height={36} preview={false} src={`https://cdn.casbin.org/img/social_${text.toLowerCase()}.png`} <Image width={36} height={36} preview={false} src={`${Setting.StaticBaseUrl}/img/social_${text.toLowerCase()}.png`}
fallback="https://cdn.casbin.org/img/social_default.png" alt={text} /> fallback={`${Setting.StaticBaseUrl}/img/social_default.png`} alt={text} />
) : ( ) : (
<Image width={36} height={36} preview={false} src={"https://cdn.casbin.org/img/social_default.png"} alt="default" /> <Image width={36} height={36} preview={false} src={`${Setting.StaticBaseUrl}/img/social_default.png`} alt="default" />
)} )}
</Tooltip> </Tooltip>
), ),