diff --git a/Dockerfile b/Dockerfile index 0cb6f29..52dc353 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,9 @@ COPY . . RUN npm install -g pnpm --registry=https://registry.npmmirror.com RUN pnpm config set registry https://registry.npmmirror.com +# canvas 原生模块:预编译包/headers 走 npmmirror 镜像(GitHub 与 nodejs.org 直连 404/被墙) +ENV canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas/ +ENV npm_config_disturl=https://registry.npmmirror.com/-/binary/node/ RUN pnpm install RUN ["pnpm", "build"] diff --git a/src/components/hubInfo.vue b/src/components/hubInfo.vue index b003e4a..326db41 100644 --- a/src/components/hubInfo.vue +++ b/src/components/hubInfo.vue @@ -15,7 +15,7 @@ :content="hasNew ? `有新版本 v${upd.latest_version}` : `当前版本 v${version}`" placement="bottom" > - + v{{ version }} v{{ version }} @@ -93,7 +93,7 @@ function openPanel() { } } -async function load(_force?: boolean) { +async function load() { try { const d = await (await fetch('/api/hub/status')).json(); if (d.version) version.value = d.version; @@ -116,7 +116,7 @@ async function load(_force?: boolean) { onMounted(() => { load(); // 心跳(服务端已节流 30min,这里只是触发) - fetch('/api/hub/heartbeat', { method: 'POST' }).catch(() => {}); + fetch('/api/hub/heartbeat', { method: 'POST' }).catch(() => { /* 心跳失败静默 */ }); // 页面重新可见时补一次(服务端节流兜底) document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') load();