feat: 新增免费演出雷达工具与定投评估功能,优化周报提醒逻辑
1. 新增免费演出雷达工具:含秀动/猫眼/大麦平台抓取、本地代理鉴权配置 2. 新增建行定投评估模块:四大指数PE-TTM估值与定投档位建议 3. 新增推送告警白名单过滤功能,限制推送指定指数告警 4. 重构周报首页提醒逻辑,移至服务端处理并减少前端请求 5. 新增多套调试探针脚本与单元测试用例
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* 探针脚本(第三轮):
|
||||
* - 中证官网 index-perf 完整字段结构(确认是否含市盈率字段)
|
||||
* - 蛋卷 pe_percentile 的统计窗口确认
|
||||
* 用法:node dev_test_scripts/debug/debug_dip_eval_sources3.js
|
||||
*/
|
||||
const axios = require('axios')
|
||||
const UA = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36' }
|
||||
|
||||
;(async () => {
|
||||
// 中证官网:打印最新一条记录的完整字段
|
||||
try {
|
||||
const res = await axios.get('https://www.csindex.com.cn/csindex-home/perf/index-perf?indexCode=000300&startDate=20260701&endDate=20260804', {
|
||||
timeout: 15000, headers: { ...UA, 'Referer': 'https://www.csindex.com.cn/' }, validateStatus: () => true
|
||||
})
|
||||
const d = res.data && res.data.data
|
||||
if (Array.isArray(d) && d.length) {
|
||||
const last = d[d.length - 1]
|
||||
console.log('[中证官网 000300 最新记录全字段]')
|
||||
console.log(JSON.stringify(last, null, 2))
|
||||
console.log('\n字段列表:', Object.keys(last).join(', '))
|
||||
} else {
|
||||
console.log('[中证官网] 无数据', JSON.stringify(res.data).slice(0, 300))
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[中证官网] 异常:', e.message)
|
||||
}
|
||||
|
||||
// 蛋卷:SH000300 完整字段
|
||||
try {
|
||||
const res = await axios.get('https://danjuanfunds.com/djapi/index_eva/dj', { timeout: 15000, headers: UA, validateStatus: () => true })
|
||||
const items = (res.data && res.data.data && res.data.data.items) || []
|
||||
const t = items.find(i => i.index_code === 'SH000300')
|
||||
if (t) {
|
||||
console.log('\n[蛋卷 SH000300 全字段]')
|
||||
console.log(JSON.stringify(t, null, 2))
|
||||
console.log('ts 对应北京时间:', new Date(t.ts + 8 * 3600 * 1000).toISOString().replace('T', ' ').slice(0, 19))
|
||||
console.log('begin_at 对应北京时间:', new Date(t.begin_at + 8 * 3600 * 1000).toISOString().replace('T', ' ').slice(0, 19))
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[蛋卷] 异常:', e.message)
|
||||
}
|
||||
})()
|
||||
Reference in New Issue
Block a user