diff --git a/src/App.vue b/src/App.vue index 0f19ddd..0f2fcce 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,6 @@ diff --git a/src/api/index.ts b/src/api/index.ts index c96e105..60427e8 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -19,6 +19,26 @@ export function getLoginWechatCode( }) } +/** + * 上报客户端错误日志(免登录、免权限、免鉴权,服务端写 wms_client_error_log) + * - 入参支持单条对象/数组/{logs:[...]} 三种形态,单次最多 50 条;这里统一用 { logs } 包裹 + * - error_message 与 error_stack 至少一项有值;report_uuid 幂等去重(重复上报静默成功) + */ +export function uploadClientErrorLog( + logs: Record[] | Record, + options?: RequestOptions +) { + const list = Array.isArray(logs) ? logs : [logs] + return request( + 'index.uploadClientErrorLog', + { logs: list }, + { + skipAuth: true, + ...options, + } + ) +} + /** * 工作台登录:获取工作台绑定码 / 绑定状态(免登录、免鉴权) * - 不传 clientCode:分配新客户端编码并立即返回绑定码 diff --git a/src/components/scan-diag-panel.vue b/src/components/scan-diag-panel.vue index aaf4c36..e814a15 100644 --- a/src/components/scan-diag-panel.vue +++ b/src/components/scan-diag-panel.vue @@ -5,6 +5,7 @@ 扫码诊断 刷新 + 上报 复制 清空 × @@ -22,6 +23,7 @@