联动,定时任务

This commit is contained in:
2025-09-08 20:53:24 +08:00
commit 517345471a
76 changed files with 18541 additions and 0 deletions

17
src/utils/arrUtils Normal file
View File

@@ -0,0 +1,17 @@
/** 从 app 列表里找 TikTok 的 bundleId */
export function pickTikTokBundleId(apps) {
if (!Array.isArray(apps)) return null
// 1) 首选常见的 TikTok 包名
const preferred = apps.find(a => a?.bundleId === 'com.zhiliaoapp.musically')
if (preferred) return preferred.bundleId
// 2) 其次按名字匹配(大小写不敏感)
const byName = apps.find(a => String(a?.name).toLowerCase() === 'tiktok')
|| apps.find(a => String(a?.name).toLowerCase().includes('tiktok'))
if (byName) return byName.bundleId
// 3) 兜底bundleId 里包含 musically
const fuzzy = apps.find(a => String(a?.bundleId || '').includes('musically'))
return fuzzy ? fuzzy.bundleId : null
}