fix:检查版本升级导致的环境报错

This commit is contained in:
Daniel
2026-03-16 23:05:01 +08:00
parent 29c473890a
commit 1a339d82cd
3 changed files with 15 additions and 6 deletions

View File

@@ -808,7 +808,8 @@
async function checkHealth() {
try {
const res = await fetch('/health', { cache: 'no-store' });
// 通过 /api/ws-status 检测后端是否可用(同时避免某些部署环境未透出 /health
const res = await fetch('/api/ws-status', { cache: 'no-store' });
if (!res.ok) throw new Error('status ' + res.status);
const data = await res.json().catch(() => ({}));
$('health-dot').style.background = '#22c55e';