From 5f582c09bab4565eea1d07bf63ab038d5f685fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 15 Nov 2024 09:56:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E5=85=B3=E9=97=ADss?= =?UTF-8?q?e=E5=8A=9F=E8=83=BD=20=E7=99=BB=E5=87=BA=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E4=BC=9A=E5=8F=91=E9=80=81sse=E5=85=B3=E9=97=AD=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/login.ts b/src/api/login.ts index 38b61a0..35e6a4e 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,10 +51,12 @@ export function register(data: any) { * 注销 */ export function logout() { - request({ - url: '/resource/sse/close', - method: 'get' - }); + if (import.meta.env.VITE_APP_SSE === 'true') { + request({ + url: '/resource/sse/close', + method: 'get' + }); + } return request({ url: '/auth/logout', method: 'post'