chore: sse配置文件关闭

This commit is contained in:
dap
2024-12-19 11:27:23 +08:00
parent 6183d22b20
commit d304e8a2a3
6 changed files with 28 additions and 13 deletions

View File

@@ -4,7 +4,10 @@ import { useAppConfig } from '@vben/hooks';
import { requestClient } from '#/api/request';
const { clientId } = useAppConfig(import.meta.env, import.meta.env.PROD);
const { clientId, sseEnable } = useAppConfig(
import.meta.env,
import.meta.env.PROD,
);
export namespace AuthApi {
/**
@@ -96,6 +99,12 @@ export function doLogout() {
* @returns void
*/
export function seeConnectionClose() {
/**
* 未开启sse 不需要处理
*/
if (!sseEnable) {
return;
}
return requestClient.get<void>('/resource/sse/close');
}