From 38a42bb2658f61a9fe66c1160578804d91010d35 Mon Sep 17 00:00:00 2001 From: JustSong Date: Fri, 31 Jan 2025 23:01:03 +0800 Subject: [PATCH] chore: update default theme style --- web/default/src/pages/About/index.js | 76 +++++++--------- web/default/src/pages/Dashboard/Dashboard.css | 24 ++++++ web/default/src/pages/Log/index.js | 17 ++-- web/default/src/pages/Setting/index.js | 30 +++++-- web/default/src/pages/TopUp/index.js | 86 ++++++++++--------- 5 files changed, 133 insertions(+), 100 deletions(-) diff --git a/web/default/src/pages/About/index.js b/web/default/src/pages/About/index.js index ec13f151..4cda2880 100644 --- a/web/default/src/pages/About/index.js +++ b/web/default/src/pages/About/index.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Header, Segment } from 'semantic-ui-react'; +import { Card } from 'semantic-ui-react'; import { API, showError } from '../../helpers'; import { marked } from 'marked'; @@ -7,52 +7,40 @@ const About = () => { const [about, setAbout] = useState(''); const [aboutLoaded, setAboutLoaded] = useState(false); - 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('加载关于内容失败...'); - } - setAboutLoaded(true); - }; - - useEffect(() => { - displayAbout().then(); - }, []); + // ... 其他函数保持不变 ... return ( - <> - { - aboutLoaded && about === '' ? <> - -
关于
-

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

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