feat: 新增 macOS 原生 SwiftUI 客户端
CI / lint-and-build (push) Has been cancelled

- Swift 6 + SwiftUI + SwiftData 直接调用阿里云 VOD API

- 自实现 POP 签名,无需 Node 后端

- 视频列表、搜索、批量下载到用户选择目录

- 下载文件自动使用视频标题重命名

- 浏览器下载与下载工具(aria2/wget)两种方式

- Web 版标记为废弃,README/AGENTS/MEMORY 更新
This commit is contained in:
2026-06-30 08:38:43 +06:00
parent 50e5a4182a
commit e8c3e4644e
21 changed files with 1557 additions and 176 deletions
@@ -0,0 +1,49 @@
import Foundation
import SwiftData
@MainActor
class AccountStore: ObservableObject {
static let shared = AccountStore()
@Published var accounts: [Account] = []
@Published var activeAccount: Account?
private init() {}
func load() async {
accounts = await DatabaseManager.shared.allAccounts()
activeAccount = await DatabaseManager.shared.activeAccount()
if let account = activeAccount {
await VODClient.shared.setActiveAccount(account)
}
}
func addAccount(_ account: Account) async {
await DatabaseManager.shared.save(account)
if account.isActive {
await DatabaseManager.shared.clearActiveAccounts()
account.isActive = true
await DatabaseManager.shared.save(account)
}
await load()
}
func updateAccount(_ account: Account) async {
await DatabaseManager.shared.save(account)
await load()
}
func deleteAccount(_ account: Account) async {
await DatabaseManager.shared.delete(account)
await load()
}
func switchActive(_ account: Account) async {
await DatabaseManager.shared.clearActiveAccounts()
account.isActive = true
account.updatedAt = Date()
await DatabaseManager.shared.save(account)
await VODClient.shared.setActiveAccount(account)
await load()
}
}