diff --git a/README.md b/README.md index 8445fb2..9bea1e8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,15 @@ wails build -debug -nopackage GUI 二进制输出到 `build/bin/huya-gui`。开发时可以使用 `wails dev` 启动 Wails + React + Ant Design 界面。 +Windows exe(文件名带版本号): + +```bash +./scripts/build-windows.sh # 默认 windows/amd64 +./scripts/build-windows.sh arm64 # 如需 windows/arm64 +``` + +产物为 `build/bin/huya-gui-v<版本>.exe`(PE32+ GUI)。版本号的单一来源是 `internal/version/version.go`:脚本从这里读取版本号,既拼进 exe 文件名,也通过 `-ldflags "-X huya-go/internal/version.Version=..."` 编译进程序,界面左下角的版本标签来自同一个值。发布新版本时改这一处,并同步 `wails.json` 的 `info.productVersion`(只影响 exe 文件属性)。在 macOS 上交叉编译不会生成 NSIS 安装包(`-nopackage`),只产出 exe。 + ## Cookie 推荐把账号 Cookie 放到本地文件,一行一个账号: diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2e0ab77..d807777 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -43,6 +43,7 @@ import { GetLogs, GetLogStats, GetRecords, + GetVersion, IsRunning, ListPrizes, OpenLogDir, @@ -572,6 +573,7 @@ export default function Dashboard() { const [logFilter, setLogFilter] = useState('all') const [debugLog, setDebugLog] = useState(false) const [instanceInfo, setInstanceInfo] = useState(null) + const [appVersion, setAppVersion] = useState('') const applyCookieEntries = async (entries: CookieEntry[], persist = true, refreshLatest = false) => { const normalizedEntries = entries @@ -616,13 +618,22 @@ export default function Dashboard() { useEffect(() => { let mounted = true - Promise.all([DefaultConfig(), GetLogs(0), IsRunning(), GetLogFilePath(), GetInstanceInfo(), GetLogStats()]) - .then(([defaults, logItems, isRunning, savedLogPath, info, stats]) => { + Promise.all([ + DefaultConfig(), + GetLogs(0), + IsRunning(), + GetLogFilePath(), + GetInstanceInfo(), + GetLogStats(), + GetVersion(), + ]) + .then(([defaults, logItems, isRunning, savedLogPath, info, stats, version]) => { if (!mounted) return const instance = info as InstanceInfo | null // 本地存储必须按实例分片后再读取,否则多开时两个实例会共用同一份账号与配置。 applyStorageScope(instance?.id || '') setInstanceInfo(instance) + setAppVersion(String(version || '')) setLogStats((stats || null) as LogStats | null) setDebugLog(String((stats as LogStats | null)?.level || '') === 'debug') @@ -1437,7 +1448,7 @@ export default function Dashboard() { 虎牙抢购 实时库存 · 多账号 · 定时触发 - v0.2.0 + {appVersion || '…'}