chore: 上线前优化 — 清理调试日志/启用组件按需注入/补全组件声明
- 移除全项目 34 处调试 console.* 输出 - project.config.json: minified true、uploadWithSourceMap false、启用 lazyCodeLoading(requiredComponents 组件按需注入) - pages/records/records.json 补全 ui-skeleton 组件声明(此前漏声明,WXML 已使用) - 删除根目录残留 preview-buttons.html
This commit is contained in:
@@ -117,7 +117,6 @@ const _resolveAvatars = async (urls) => {
|
||||
if (f && f.fileID && f.tempFileURL) map[f.fileID] = f.tempFileURL
|
||||
})
|
||||
} catch (e) {
|
||||
console.warn('[leaderboard] getTempFileURL batch failed:', e)
|
||||
}
|
||||
}
|
||||
return (urls || []).map(u => (u && map[u]) ? map[u] : u)
|
||||
@@ -305,12 +304,9 @@ const _persistSnapshot = async (period, result) => {
|
||||
updatedAt: new Date().toISOString()
|
||||
}
|
||||
}
|
||||
console.log('[leaderboard] persisting snapshot', period, 'rankedLen=', ranked.length)
|
||||
const docRef = db.collection(SNAPSHOT_COLLECTION).doc(period)
|
||||
const setRes = await docRef.set(payload)
|
||||
console.log('[leaderboard] persist ok', period, JSON.stringify(setRes))
|
||||
} catch (e) {
|
||||
console.warn('[leaderboard] persist snapshot failed for', period, e && e.errMsg ? e.errMsg : e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +342,6 @@ const _rebuildSnapshots = async () => {
|
||||
const latestByOpenid = await _fetchLatestByOpenid(true)
|
||||
for (const p of ['day', 'month', 'year', 'endurance']) {
|
||||
const result = await _buildFromScan(latestByOpenid, p, SNAPSHOT_TOP, null)
|
||||
console.log('[leaderboard] rebuilt', p, 'rankedLen=', (result && result.ranked) ? result.ranked.length : 'undef')
|
||||
await _persistSnapshot(p, result)
|
||||
}
|
||||
return { ok: true, rebuiltAt: new Date().toISOString() }
|
||||
|
||||
Reference in New Issue
Block a user