diff --git a/frontend/package.json b/frontend/package.json index 2983483..27443b0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "0.0.0", + "version": "1.0.1", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 23205a6..f79b8f8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -21,6 +21,7 @@ import UserManagement from './pages/UserManagement'; import Login from './pages/Login'; import AuthCallback from './pages/AuthCallback'; import ProtectedRoute from './components/ProtectedRoute'; +import AppFooter from './components/AppFooter'; import './App.css'; function App() { @@ -33,11 +34,11 @@ function App() { }} > - } /> + } /> } /> - } /> - } /> + <>} /> + <>} /> } /> } /> } /> diff --git a/frontend/src/components/AppFooter.tsx b/frontend/src/components/AppFooter.tsx new file mode 100644 index 0000000..b944bfe --- /dev/null +++ b/frontend/src/components/AppFooter.tsx @@ -0,0 +1,193 @@ +import { Typography, Space, Divider } from 'antd'; +import { GithubOutlined, CopyrightOutlined, HeartFilled, ClockCircleOutlined } from '@ant-design/icons'; +import { VERSION_INFO, getVersionString } from '../config/version'; + +const { Text, Link } = Typography; + +export default function AppFooter() { + const isMobile = window.innerWidth <= 768; + + return ( +
+
+ {isMobile ? ( + // 移动端:紧凑单行布局 +
+ + {VERSION_INFO.projectName} + {getVersionString()} + + + + + + + + {VERSION_INFO.buildTime} + +
+ ) : ( + // PC端:完整布局 + } + style={{ + display: 'flex', + justifyContent: 'center', + alignItems: 'center' + }} + > + {/* 版本信息 */} + + {VERSION_INFO.projectName} + {getVersionString()} + + + {/* GitHub 链接 */} + + + GitHub + + + {/* LinuxDO 社区 */} + + LinuxDO 社区 + + + {/* 许可证 */} + + + {VERSION_INFO.license} + + + {/* 更新时间 */} + + + {VERSION_INFO.buildTime} + + + {/* 致谢信息 */} + + Made with + + by {VERSION_INFO.author} + + + )} +
+
+ ); +} \ No newline at end of file diff --git a/frontend/src/config/version.ts b/frontend/src/config/version.ts new file mode 100644 index 0000000..62214e2 --- /dev/null +++ b/frontend/src/config/version.ts @@ -0,0 +1,41 @@ +/** + * 应用版本信息配置 + * 版本号遵循语义化版本规范 (Semantic Versioning) + */ + +export const VERSION_INFO = { + // 应用版本号 + version: '1.0.1', + + // 构建时间(将在构建时由 Vite 注入) + buildTime: import.meta.env.VITE_BUILD_TIME || new Date().toISOString().split('T')[0], + + // 项目信息 + projectName: 'MuMuAINovel', + projectFullName: 'MuMu AI 小说创作助手', + + // 链接信息 + githubUrl: 'https://github.com/xiamuceer-j/MuMuAINovel', + linuxDoUrl: 'https://linux.do/t/topic/1106333', + + // 许可证 + license: 'GPL v3.0', + licenseUrl: 'https://www.gnu.org/licenses/gpl-3.0.html', + + // 作者信息 + author: 'xiamuceer-j', +}; + +/** + * 获取格式化的版本信息 + */ +export const getVersionString = () => { + return `v${VERSION_INFO.version}`; +}; + +/** + * 获取完整的版本描述 + */ +export const getFullVersionInfo = () => { + return `${VERSION_INFO.projectName} ${getVersionString()} - Build ${VERSION_INFO.buildTime}`; +}; \ No newline at end of file diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index abf8deb..ee261c4 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -4,6 +4,12 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], + // 定义全局常量,在构建时注入 + define: { + 'import.meta.env.VITE_BUILD_TIME': JSON.stringify( + new Date().toISOString().split('T')[0] + ), + }, build: { outDir: '../backend/static', emptyOutDir: true,