/* Copyright (C) 2025 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ import React, { useEffect, useState } from 'react'; import { API, showError } from '../../helpers'; import { marked } from 'marked'; import { Empty } from '@douyinfe/semi-ui'; import { IllustrationConstruction, IllustrationConstructionDark, } from '@douyinfe/semi-illustrations'; import { useTranslation } from 'react-i18next'; const About = () => { const { t } = useTranslation(); const [about, setAbout] = useState(''); const [aboutLoaded, setAboutLoaded] = useState(false); const currentYear = new Date().getFullYear(); const displayAbout = async () => { setAbout(localStorage.getItem('about') || ''); const res = await API.get('/api/about'); const { success, message, data } = res.data; if (success) { let aboutContent = data; if (!data.startsWith('https://')) { aboutContent = marked.parse(data); } setAbout(aboutContent); localStorage.setItem('about', aboutContent); } else { showError(message); setAbout(t('加载关于内容失败...')); } setAboutLoaded(true); }; useEffect(() => { displayAbout().then(); }, []); const emptyStyle = { padding: '24px', }; const customDescription = (

{t('可在设置页面设置关于内容,支持 HTML & Markdown')}

{t('New API项目仓库地址:')} https://github.com/QuantumNous/new-api

NewAPI {' '} {t('© {{currentYear}}', { currentYear })}{' '} QuantumNous {' '} {t('| 基于')}{' '} One API v0.5.4 {' '} © 2023{' '} JustSong

{t('本项目根据')} {t('MIT许可证')} {t('授权,需在遵守')} {t('AGPL v3.0协议')} {t('的前提下使用。')}

); return (
{aboutLoaded && about === '' ? (
} darkModeImage={ } description={t('管理员暂时未设置任何关于内容')} style={emptyStyle} > {customDescription}
) : ( <> {about.startsWith('https://') ? (