| | |
| | | this.showJsonDetail(row, 'request'); |
| | | } else if (column.property === 'responseJson' && row.responseJson) { |
| | | this.showJsonDetail(row, 'response'); |
| | | } else if (column.property === 'errorMessage' && row.errorMessage) { |
| | | this.showJsonDetail(row, 'errorMessage'); |
| | | } |
| | | }, |
| | | |
| | | // 显示 JSON 详情抽屉 |
| | | showJsonDetail(row, type = 'request') { |
| | | const jsonContent = type === 'request' ? row.requestJson : row.responseJson; |
| | | const title = type === 'request' ? '📋 请求 JSON' : '📥 响应 JSON'; |
| | | const jsonContent = type === 'request' ? row.requestJson : type === 'response' ? row.responseJson : row.errorMessage; |
| | | const title = type === 'request' ? '📋 请求 JSON' : type === 'response' ? '📋 请求 JSON': '📥 错误消息'; |
| | | |
| | | // 解析 JSON 对象,解析失败则保留原始字符串 |
| | | let jsonData; |