v0.3.14: cookie_uid/空间修复 + checkin/cleanup统一走getter解密

修复:
- testCloudConnection: 验证成功后更新cookie_uid和storageUsed
- 5个getter SELECT添加cookie_uid列
- checkin.service: dailyCheckIn改用getCloudConfigById(自带解密)
- cleanup.service: getActiveCleanupConfigs改用getActiveCloudConfigs(自带解密)
- checkin/cleanup不再直接查DB绕开解密
This commit is contained in:
2026-05-17 15:49:43 +08:00
parent eebf4b6c97
commit ea03ff2203
5 changed files with 17 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import { getDb } from '../database/database';
import { getSystemConfig, updateSystemConfig } from '../admin/system-config.service';
import { formatLocalDate, formatLocalDateTime } from '../utils/time';
import { QuarkDriver } from './drivers/quark.driver';
import { CloudConfig, getActiveCloudConfigs } from './credential.service';
import { BaiduDriver } from './drivers/baidu.driver';
// ═══════════════════════════════════════════════════════════════════════════
@@ -63,12 +64,9 @@ interface CleanupStats {
}
/** Get all active cloud configs (any type). Used by the orchestrator. */
function getActiveCleanupConfigs(): Array<{ id: number; cloud_type: string; cookie: string; nickname?: string }> {
const db = getDb();
return db.prepare(
`SELECT id, cloud_type, cookie, nickname FROM cloud_configs
WHERE is_active = 1 AND cookie IS NOT NULL AND cookie != ''`
).all() as Array<{ id: number; cloud_type: string; cookie: string; nickname?: string }>;
function getActiveCleanupConfigs() {
const configs = getActiveCloudConfigs();
return configs.filter((c): c is CloudConfig & { cookie: string } => !!c.cookie);
}
/**