remove pagespy
All checks were successful
Docker Build and Push / build-image (push) Successful in 4m56s

This commit is contained in:
cheney 2026-08-08 18:12:48 +08:00
parent 1b330bdd4d
commit 2fa7c7fc70
6 changed files with 30 additions and 80 deletions

View File

@ -12,6 +12,11 @@ on:
jobs:
build-image:
runs-on: ubuntu-latest
env:
# 关键: 显式固定 Android/OTA 后端地址, 覆盖 runner 环境里可能存在的
# 其他 VITE_API_BASE 值。否则 OTA 包里的前端可能连错后端, 导致
# "OTA 更新后登录失败/进不去内部"。与 android-build.yml 保持一致。
VITE_API_BASE: http://bh.vps.honor3.com:3001
steps:
- uses: https://gitea.com/actions/checkout@v4

30
package-lock.json generated
View File

@ -8,7 +8,6 @@
"name": "iboard",
"version": "1.0.0",
"dependencies": {
"@huolala-tech/page-spy": "^1.5.7",
"@prisma/adapter-mariadb": "^7.9.1",
"@prisma/client": "^7.7.0",
"antd-mobile": "^5.42.3",
@ -807,20 +806,6 @@
"hono": "^4"
}
},
"node_modules/@huolala-tech/page-spy": {
"version": "1.5.7",
"resolved": "https://registry.npmmirror.com/@huolala-tech/page-spy/-/page-spy-1.5.7.tgz",
"integrity": "sha512-M19WkH6K2taPpdi7gZ9Tz6v0vY/yW4ziffPXdU+p9+pdSmu1s0OhfxjcsWgERAYsaRLZNloSWqJZyWT5zsYIwA==",
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.13.0",
"copy-to-clipboard": "^3.3.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@img/sharp-darwin-arm64": {
"version": "0.33.5",
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz",
@ -3242,15 +3227,6 @@
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
"license": "MIT"
},
"node_modules/copy-to-clipboard": {
"version": "3.3.3",
"resolved": "https://registry.npmmirror.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz",
"integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==",
"license": "MIT",
"dependencies": {
"toggle-selection": "^1.0.6"
}
},
"node_modules/cors": {
"version": "2.8.6",
"resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.6.tgz",
@ -6039,12 +6015,6 @@
"node": ">=18"
}
},
"node_modules/toggle-selection": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/toggle-selection/-/toggle-selection-1.0.6.tgz",
"integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==",
"license": "MIT"
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",

View File

@ -27,7 +27,6 @@
"publish": "bash scripts/wsl/build-apk.sh release"
},
"dependencies": {
"@huolala-tech/page-spy": "^1.5.7",
"@prisma/adapter-mariadb": "^7.9.1",
"@prisma/client": "^7.7.0",
"antd-mobile": "^5.42.3",

View File

@ -8,7 +8,7 @@
import { getApiBase, getToken } from './client.js'
import { APP_VERSION, BUILD_ID } from '../version.js'
// 判断是否在 Tauri WebView 内 (与 src/debug/pagespy.js 同样的判定)
// 判断是否在 Tauri WebView 内 (有 __TAURI_INTERNALS__ 即 Tauri 环境)
const inTauri = typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window
// 拼接绝对 URL: 在 Tauri (VITE_API_BASE 有值) 时直连, 否则同源

View File

@ -1,21 +0,0 @@
// 仅在 Tauri WebView 内启用 PageSpy, 用于生产环境远程调试.
// web 模式 (Vite dev / 浏览器) 通过检测 window.__TAURI_INTERNALS__ 直接跳过,
// 配合 dynamic import 让 page-spy 这个 chunk 在 web 模式下完全不下载.
// VITE_PAGESPY_API 留空可关闭连接 (例如本地调试不想连远端 PageSpy 服务时).
// 加载失败不阻塞应用启动, 仅 console.warn 提示.
const PAGESPY_API = import.meta.env.VITE_PAGESPY_API || 'http://bh.vps.honor3.com:6752'
const inTauri = typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window
if (inTauri && PAGESPY_API) {
// 动态 import: 仅在 Tauri 内才下载 page-spy chunk
import('@huolala-tech/page-spy')
.then(({ default: PageSpy }) => {
// PageSpy 默认会 hook fetch / XMLHttpRequest, 自动抓取网络请求和错误
const instance = new PageSpy({ api: PAGESPY_API })
window.__IBOARD_PAGESPY__ = instance
})
.catch((err) => {
console.warn('[PageSpy] init failed:', err)
})
}

View File

@ -1,6 +1,3 @@
// : Tauri WebView , web
import './debug/pagespy.js'
// UI : + (antd-mobile 5)
import 'antd-mobile/es/global'