fix: 优化虫 机制,新增伊朗支援
This commit is contained in:
@@ -79,6 +79,8 @@ function getSituation() {
|
||||
const trend = db.prepare('SELECT time, value FROM wall_street_trend ORDER BY time').all()
|
||||
const retaliationCur = db.prepare('SELECT value FROM retaliation_current WHERE id = 1').get()
|
||||
const retaliationHist = db.prepare('SELECT time, value FROM retaliation_history ORDER BY time').all()
|
||||
// 反击情绪无记录时给默认 50,避免爬虫未写入时前端显示 0
|
||||
const retaliationValue = retaliationCur?.value ?? 50
|
||||
const updates = db.prepare('SELECT * FROM situation_update ORDER BY timestamp DESC LIMIT 50').all()
|
||||
// 数据更新时间:与前端「实时更新」一致,仅在爬虫 notify / 编辑保存时由 index.js 或 routes 更新
|
||||
const meta = db.prepare('SELECT updated_at FROM situation WHERE id = 1').get()
|
||||
@@ -157,7 +159,7 @@ function getSituation() {
|
||||
assets: (assetsIr || []).map(toAsset),
|
||||
keyLocations: locIr || [],
|
||||
combatLosses: irLosses,
|
||||
retaliationSentiment: retaliationCur?.value ?? 0,
|
||||
retaliationSentiment: retaliationValue,
|
||||
retaliationSentimentHistory: retaliationHist || [],
|
||||
},
|
||||
recentUpdates: (updates || []).map((u) => ({
|
||||
|
||||
Reference in New Issue
Block a user