Skip to content

Commit

Permalink
test: 测试handleHttpStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
xy-sea committed Apr 25, 2023
1 parent aa9f429 commit 2907d02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ repeatCodeError 设置为 true 时,将开启一个缓存 map,存入已发生
在用户的同一次会话中,如果点击一个按钮出现了错误,那么再次点击同一个按钮,必定会出现同一个错误,而这出现的多次错误,影响的是同一个用户、同一次访问;所以将其全部上报是没有意义的;
而在同一个用户的不同会话中,如果出现了同一个错误,那么这不同会话里的错误进行上报就显得有意义了

web-see 根据错误堆栈信息,将`错误信息、错误文件、错误行号`聚合生成一个 hash 值,这个值是这个错误唯一性的 ID
web-see 根据错误堆栈信息,将`错误信息、错误文件、错误行号`聚合生成一个 hash 值,是这个错误唯一的 ID

```javascript
// 对每一个错误详情,生成唯一的编码
Expand Down
1 change: 1 addition & 0 deletions test/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Vue.use(webSee, {
repeatCodeError: true,
userId: '123',
handleHttpStatus(data) {
console.log('data', data);
let { url, response } = data;
// code为200,接口正常,反之亦然
let { code } = typeof response === 'string' ? JSON.parse(response) : response;
Expand Down

0 comments on commit 2907d02

Please sign in to comment.