hjhan
c519dcf44f
fix: otcDebug 开关在 _InfoLayout(TradeEdit)页面也能从URL读取
根因(用户反馈:开了 ?otcdebug=1 但输入/计算无任何 console 输出):
1. 用户实际在 /swapTrade2/TradeList 页面——该页不加载 swapTradeEdit.js(埋点所在),
只加载 swapTradeList.js(零债券代码),故三字段 trace 永远不会执行。
2. 即使跳到 TradeEdit 页面,_InfoLayout.cshtml(TradeEdit 用的 layout)
未灌入 window.ylotc.__diag,导致 main.js 中:
var __otcDiag = (window.ylotc && window.ylotc.__diag) || { debug: false };
→ debug 永远 false → 所有 otcDebug.log 全部空转。
修复:main.js 的 __otcDiag 初始化改为双源读取——
优先用 _MainLayout 灌入的 ylotc.__diag(含 jsVersion/git/built 元数据);
若 layout 未灌入(_InfoLayout 等),则从 ?otcdebug=1 / localStorage.otcdebug 直接读,
确保 debug 开关在所有页面生效。
测试:diag 18 + bondCalc 81 = 99 例全过。
注意:此改动在 main.js 中,需重建 bundle.js 才能生效(dotnet publish 自动触发)。
2026-07-30 10:30:31 +08:00
..
2024-05-09 14:06:26 +08:00
2026-07-30 10:15:00 +08:00
2026-07-30 10:30:31 +08:00
2024-05-09 14:06:26 +08:00
2026-07-30 10:06:21 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-07-29 16:32:15 +08:00
2026-07-28 14:50:05 +08:00