diff --git a/src/views/InstanceDetail.vue b/src/views/InstanceDetail.vue index 0518c9f..f89d78f 100644 --- a/src/views/InstanceDetail.vue +++ b/src/views/InstanceDetail.vue @@ -446,7 +446,7 @@ export default { const token = getCookie('token'); const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const target = __APP_TARGET__; - const wsUrl = `${wsProtocol}//${target}/frpcAct/instanceMgr/logs?instanceID=${instanceID.value}&token=${token}`; + const wsUrl = `${wsProtocol}//${target}/api/frpcAct/instanceMgr/logs?instanceID=${instanceID.value}&token=${token}`; logSocket = new WebSocket(wsUrl); diff --git a/src/views/Logs.vue b/src/views/Logs.vue index 86b4954..2dfe189 100644 --- a/src/views/Logs.vue +++ b/src/views/Logs.vue @@ -62,7 +62,7 @@ export default { const token = getCookie('token'); const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const target = __APP_TARGET__; - const wsUrl = `${wsProtocol}//${target}/system/getLogs?token=${token}`; + const wsUrl = `${wsProtocol}//${target}/api/system/getLogs?token=${token}`; socket.value = new WebSocket(wsUrl); diff --git a/vite.config.js b/vite.config.js index ec305e0..34894e6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,7 +13,7 @@ export default defineConfig({ port: 3000, proxy: { '/api': { - target: `http://${APP_TARGET}`, + target: `http://${APP_TARGET}/api`, changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') }