diff --git a/web/src/components/OtherSetting.js b/web/src/components/OtherSetting.js index b1ac5de83f..66fb62b022 100644 --- a/web/src/components/OtherSetting.js +++ b/web/src/components/OtherSetting.js @@ -121,14 +121,14 @@ const OtherSetting = () => { value={inputs.HomePageContent} name='HomePageContent' onChange={handleInputChange} - style={{ minHeight: 300, fontFamily: 'JetBrains Mono, Consolas' }} + style={{ minHeight: 150, fontFamily: 'JetBrains Mono, Consolas' }} /> submitOption('HomePageContent')}>保存首页内容 { const res = await API.get('/api/about'); const { success, message, data } = res.data; if (success) { - let HTMLAbout = marked.parse(data); - setAbout(HTMLAbout); - localStorage.setItem('about', HTMLAbout); + let aboutContent = data; + if (!data.startsWith('https://')) { + aboutContent = marked.parse(data); + } + setAbout(aboutContent); + localStorage.setItem('about', aboutContent); } else { showError(message); setAbout('加载关于内容失败...'); @@ -28,20 +31,27 @@ const About = () => { return ( <> - - { - aboutLoaded && about === '' ? <> + { + aboutLoaded && about === '' ? <> +
关于

可在设置页面设置关于内容,支持 HTML & Markdown

项目仓库地址: - + https://github.com/songquanpeng/one-api - : <> -
- - } -
+
+ : <> + { + about.startsWith('https://') ?