版本号单一来源,新增带版本号的 Windows exe 构建脚本
This commit is contained in:
+14
-3
@@ -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<InstanceInfo | null>(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() {
|
||||
<Typography.Title level={4}>虎牙抢购</Typography.Title>
|
||||
<Typography.Text type="secondary">实时库存 · 多账号 · 定时触发</Typography.Text>
|
||||
</div>
|
||||
<Tag>v0.2.0</Tag>
|
||||
<Tag>{appVersion || '…'}</Tag>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user