功能(设备ID调试): 添加调试埋点与文档以定位设备ID缺失问题
创建调试环境配置文件与调试会话记录文档,在前端页面、票据面板以及后端公共接口的设备ID解析各阶段添加调试埋点,收集原始设备数据与处理后的结果,用于验证相关假设以定位设备ID不显示的根因。
This commit is contained in:
@@ -350,6 +350,29 @@ createApp({
|
||||
const action = getTicketEventAction(ev);
|
||||
let deviceId = String(ev?.device || ev?.device_id || ev?.detail?.device || ev?.detail?.device_id || ev?.["设备编号"] || ev?.["机器ID"] || '---').trim();
|
||||
const dStr = deviceId.toLowerCase();
|
||||
|
||||
// #region debug-point B:index-ticket-device-before-map
|
||||
fetch('http://127.0.0.1:7777/event', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
sessionId: 'device-id-missing',
|
||||
runId: 'pre-fix',
|
||||
hypothesisId: 'B',
|
||||
location: 'web/index.js:351',
|
||||
msg: '[DEBUG] admin ticket formatter raw device',
|
||||
data: {
|
||||
type,
|
||||
action,
|
||||
raw_device: ev?.device ?? null,
|
||||
raw_device_id: ev?.device_id ?? null,
|
||||
raw_detail_device: ev?.detail?.device ?? null,
|
||||
resolved_before_map: deviceId
|
||||
},
|
||||
ts: Date.now()
|
||||
})
|
||||
}).catch(() => {});
|
||||
// #endregion
|
||||
|
||||
if (dStr === 'gate') {
|
||||
deviceId = '闸机';
|
||||
@@ -364,6 +387,26 @@ createApp({
|
||||
deviceId = '售票机';
|
||||
}
|
||||
}
|
||||
|
||||
// #region debug-point B:index-ticket-device-after-map
|
||||
fetch('http://127.0.0.1:7777/event', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
sessionId: 'device-id-missing',
|
||||
runId: 'pre-fix',
|
||||
hypothesisId: 'B',
|
||||
location: 'web/index.js:373',
|
||||
msg: '[DEBUG] admin ticket formatter mapped device',
|
||||
data: {
|
||||
type,
|
||||
action,
|
||||
mapped_device: deviceId
|
||||
},
|
||||
ts: Date.now()
|
||||
})
|
||||
}).catch(() => {});
|
||||
// #endregion
|
||||
const timeStr = formatTime(ev?.ts || ev?.["时间戳"]);
|
||||
|
||||
if (type === 'sale' || type === '售票') {
|
||||
|
||||
Reference in New Issue
Block a user