同步前后端联调与文档更新

This commit is contained in:
2026-04-02 09:25:05 +08:00
parent af43beadb0
commit 6964e26ec9
113 changed files with 4317 additions and 293 deletions

View File

@@ -3,9 +3,16 @@
const DEFAULT_CONFIG_URL = 'https://oss-mbh5.colormaprun.com/wxmini/test/game.json'
const DEFAULT_TILE_URL = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
const PROXY_BASE_URL = `${location.origin}/proxy?url=`
const GPS_WS_URL = `ws://${location.hostname}:17865/mock-gps`
const HEART_RATE_WS_URL = `ws://${location.hostname}:17865/mock-hr`
const DEBUG_LOG_WS_URL = `ws://${location.hostname}:17865/debug-log`
function createSameOriginWsUrl(pathname) {
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:'
const normalizedPath = String(pathname || '').startsWith('/') ? pathname : `/${pathname}`
return `${wsProtocol}//${location.host}${normalizedPath}`
}
const GPS_WS_URL = createSameOriginWsUrl('/mock-gps')
const HEART_RATE_WS_URL = createSameOriginWsUrl('/mock-hr')
const DEBUG_LOG_WS_URL = createSameOriginWsUrl('/debug-log')
const DEFAULT_GATEWAY_BRIDGE_URL = 'ws://127.0.0.1:18080/ws'
const LEGACY_GATEWAY_BRIDGE_URLS = new Set([
'ws://127.0.0.1:8080/ws',