From e1cceca3409d9b5ba0acd4744dcfbd12095c38dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 13 Oct 2024 00:46:06 +0800 Subject: [PATCH] fix: ssh session --- web/src/api/panel/website/index.ts | 2 +- web/src/views/ssh/IndexView.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/api/panel/website/index.ts b/web/src/api/panel/website/index.ts index 60baf20a..a9c9678c 100644 --- a/web/src/api/panel/website/index.ts +++ b/web/src/api/panel/website/index.ts @@ -27,7 +27,7 @@ export default { request.post('/website/' + id + '/updateRemark', { remark }), // 重置配置 resetConfig: (id: number): Promise> => - request.post('/website/' + id + '/resetConfig'), + request.post('/website/' + id + '/resetConfig', {}), // 修改状态 status: (id: number, status: boolean): Promise> => request.post('/website/' + id + '/status', { status }) diff --git a/web/src/views/ssh/IndexView.vue b/web/src/views/ssh/IndexView.vue index 63f921c0..c1ab1adf 100644 --- a/web/src/views/ssh/IndexView.vue +++ b/web/src/views/ssh/IndexView.vue @@ -51,7 +51,7 @@ const openSession = () => { term.loadAddon(fitAddon) const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws' - const ws = new WebSocket(`${protocol}://${window.location.host}/api/panel/ssh/session`) + const ws = new WebSocket(`${protocol}://${window.location.host}/api/ssh/session`) ws.binaryType = 'arraybuffer' const enc = new TextDecoder('utf-8') @@ -75,7 +75,7 @@ const openSession = () => { ws.onerror = (event) => { term.write('\r\nSSH连接发生错误,请刷新页面。') term.write('\r\nSSH connection error. Please refresh the page.\r\n') - console.error(event) + console.error(event.error) ws.close() }