feat: add url prefix path

This commit is contained in:
engigu
2026-01-13 18:18:50 +08:00
parent b07e742550
commit ff6faa229c
15 changed files with 275 additions and 53 deletions
+3 -1
View File
@@ -128,7 +128,9 @@ function initTerminal(forceConnect = false) {
function connectWebSocket() {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
const wsUrl = `${protocol}//${window.location.host}/api/terminal/ws`
const baseUrl = (window as any).__BASE_URL__ || ''
const apiVersion = (window as any).__API_VERSION__ || '/api/v1'
const wsUrl = `${protocol}//${window.location.host}${baseUrl}${apiVersion}/terminal/ws`
ws = new WebSocket(wsUrl)