Skip to content

Commit 9cbc1e5

Browse files
committed
fix: 弹窗"响应头"概览数字始终是 0
buildPopupResult 里输出的字段叫 headerCount: Object.keys(headers).length(一个数字),并不返还原始 headers 对象——后者只在 buildPopupRawResult 里有。但 Popup.vue 的 headerCount computed 一直读的是 state.result.headers 然后 Object.keys(headers || {}).length,state.result 实际只有 headerCount 数字字段没有 headers 对象,于是永远落到 Object.keys({}).length = 0。 computed 加一条优先分支:先读 state.result.headerCount,存在且是 number 就直接返回。原本读 state.result.headers 的两条 fallback 仍保留兼容历史缓存数据,但现在主路径走数字字段。 插件版本升级到 1.1.0(响应头数字第一次能正确显示,是个面向用户可见的修,从 1.0.x 跨到 1.1.x 标记一下)。
1 parent 7eff6c5 commit 9cbc1e5

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stackprism",
33
"private": true,
4-
"version": "1.0.99",
4+
"version": "1.1.0",
55
"type": "module",
66
"description": "StackPrism 用于检测网页前端、后端、CDN、SaaS、广告营销、统计、登录、支付、网站程序和主题模板线索。",
77
"scripts": {

src/ui/popup/Popup.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
340340
const headerCount = computed(() => {
341341
if (!state.result) return 0
342+
if (typeof state.result.headerCount === 'number') return state.result.headerCount
342343
const headers = state.result.headers
343344
if (Array.isArray(headers)) return headers.length
344345
return Object.keys(headers || {}).length

0 commit comments

Comments
 (0)