From 9c64282ad545035c3c0f95d5ddf73fa64d969edf Mon Sep 17 00:00:00 2001 From: NanamiAdmin Date: Tue, 5 May 2026 18:50:11 +0800 Subject: [PATCH] fix: update API endpoints to include /api prefix --- src/views/InstanceDetail.vue | 2 +- src/views/Logs.vue | 2 +- vite.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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/, '') }