diff --git a/README.md b/README.md index 7b15bcf..6583747 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,6 @@ Windows / Android 双端 · Fluent 设计 · 沉浸式竖屏播放 > ⚠️ 本项目仅供 **学习与技术交流**,不提供、不存储、不分发任何音视频内容。 > 所有内容均来自第三方站点,请自行判断合规性,并在 24 小时内删除相关资源。 -## 功能 - -- **首页**:沉浸式竖屏信息流,上下滑动切换剧集,双击/按钮点赞 -- **统一播放页**:标题、作者与关注、可展开简介、话题标签、评分;右侧竖列集成 点赞 / 评论 / 收藏 / 选集 / 分享 -- **播放器**:HLS + AES-128 解密播放、倍速、音量、画中画、影院模式、全屏、上下集切换 -- **选集**:右侧停靠面板,画面自动让位;播完自动下一集 -- **分类**:AI 短剧 / 漫剧 / 换脸 / 魔改 / 黄果吃瓜,支持 最新 / 最热 / 高分 排序与无限滚动 -- **排行榜**:热播榜 / 推荐榜 / 潜力榜 -- **搜索**:关键词搜索、搜索历史、热门题材、分页加载 -- **吃瓜**:图文与图文+视频混排,视频直接播放,纯图文在应用内阅读 -- **我的**:登录/注册、收藏与观看历史、深浅主题、关于、清理缓存 -- **双端外壳**:Windows 无边框标题栏 + 可折叠侧栏;Android 底部标签栏 + 安全区适配 ## 技术栈 diff --git a/src/components/WindowsChrome.tsx b/src/components/WindowsChrome.tsx index aa9b802..58156b3 100644 --- a/src/components/WindowsChrome.tsx +++ b/src/components/WindowsChrome.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import { getCurrentWindow } from "@tauri-apps/api/window"; import { useStore, type Tab } from "../store"; +import { APP_VERSION } from "../api"; import { Avatar } from "./ui"; import { IClose, IGrid, IGridF, IHome, IHomeF, IMinus, IMoon, IRestore, ISearch, ISidebar, @@ -87,7 +88,7 @@ export function WindowsRail({ collapsed }: { collapsed: boolean }) { {user ? "你的精彩,都在这里" : "留住每一次心动"} - HGhub for Windows 1.0.0 + HGhub for Windows {APP_VERSION} diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 151aa68..e4b9105 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1 +1,4 @@ -/// \ No newline at end of file +/// + +/** 由 vite.config.ts 的 define 注入,来源是 package.json 的 version */ +declare const __APP_VERSION__: string; \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 7b82d19..907e80f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,12 +1,20 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; +import { readFileSync } from "node:fs"; const host = process.env.TAURI_DEV_HOST; +const { version } = JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8"), +) as { version: string }; export default defineConfig({ plugins: [react(), tailwindcss()], clearScreen: false, + // 版本号只维护 package.json(CI 会按 tag 改写它),界面里的版本由这里注入,避免写死后漂移 + define: { + __APP_VERSION__: JSON.stringify(version), + }, server: { port: 1420, strictPort: true,