{"id":21513868,"url":"https://github.com/vsirrr/qa-console","last_synced_at":"2025-10-15T12:27:56.827Z","repository":{"id":175459121,"uuid":"431014069","full_name":"VSirrr/qa-console","owner":"VSirrr","description":"快应用调试工具——包含日志收集、Storage、查看网络请求功能。","archived":false,"fork":false,"pushed_at":"2022-07-07T02:55:43.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T05:46:55.211Z","etag":null,"topics":["debug","quickapp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VSirrr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-11-23T08:11:23.000Z","updated_at":"2023-06-15T02:57:10.000Z","dependencies_parsed_at":"2023-07-12T13:45:16.732Z","dependency_job_id":null,"html_url":"https://github.com/VSirrr/qa-console","commit_stats":null,"previous_names":["vsirrr/qa-console","js-only/qa-console"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VSirrr/qa-console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VSirrr%2Fqa-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VSirrr%2Fqa-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VSirrr%2Fqa-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VSirrr%2Fqa-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VSirrr","download_url":"https://codeload.github.com/VSirrr/qa-console/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VSirrr%2Fqa-console/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279078023,"owners_count":26098423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","quickapp"],"created_at":"2024-11-23T23:33:09.373Z","updated_at":"2025-10-15T12:27:56.797Z","avatar_url":"https://github.com/VSirrr.png","language":"JavaScript","readme":"# @vsirrr/qa-console\n\n## 背景\n\n- tencent/vconsole 依赖于 DOM，在快应用中不能使用。\n\n## 目前支持的功能\n\n- 重写了 console 的 log、error、debug 方法，所以只能收集通过 console.log()、console.error()、console.debug() 输出的内容，其他特殊异常无法捕获。\n- 目前一共有四个面板：Log（普通日志）、Error（错误日志）、Request（请求信息，包含请求的 url、type、status、params、response 等信息）、Storage（本地存储）\n- 长按输出的 log、error 日志内容，可以复制文本；长按 request 中的参数和返回值可以复制文本；长按 Storage 的 value 值可以复制文本。\n- 每个面板底部的工具栏：点击 clear 按钮是清空对应的内容，点击 hide 按钮是关闭弹层。\n\n## 使用方式\n\n### 安装\n\n```shell\nnpm i -D @vsirrr/qa-console\n```\n\n### demo\n\n```js\n// 1. 在 app.ux 中进行初始化\nif(process.env.NODE_ENV === 'development') {\n  require('@vsirrr/qa-console')\n}\n\n// 2. 在使用该功能的地方引入 qa-console 组件 不支持单次引用多页面使用\n\u003cimport name=\"qa-console\" src=\"@vsirrr/qa-console/component.ux\"\u003e\u003c/import\u003e\n\n\u003cqa-console\u003e\u003c/qa-console\u003e\n\n// 3. 接口提供的 @system.fetch 无法被重写。所以在封装的请求库中使用 console.debug() 方法，收集请求与响应的信息\nimport $fetch from '@system.fetch'\n\nfunction request(params) {\n  return new Promise((resolve, reject) =\u003e {\n    $fetch.fetch({\n      url: params.url,\n      method: params.method,\n      data: params.data,\n      responseType: 'json',\n      success: (response) =\u003e {\n        console.debug({\n          url: params.url,\n          method: params.method,\n          params: params.data,\n          data: response.data,\n          status: 'success',\n        })\n        resolve(response.data)\n      },\n      fail: (error, code) =\u003e {\n        const data =\n          Object.prototype.toString.call(error).slice(8, -1) === 'Object'\n            ? { code, ...error }\n            : { code, error }\n        console.debug({\n          data,\n          url: params.url,\n          method: params.method,\n          params: params.data,\n          status: 'error',\n        })\n        reject(error)\n      },\n    })\n  })\n}\n```\n\n## 注意事项\n\n- 使用完 qa-console 组件之后，把相关代码注释掉，防止打包时增加包的体积。\n\n\u003c!-- ## 问题记录 --\u003e\n\n\u003c!-- - 华为品牌手机，页面刷新之后报错（cannot set property logs of undefined at Vm.set），猜测是编译问题 --\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsirrr%2Fqa-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsirrr%2Fqa-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsirrr%2Fqa-console/lists"}