add SSE开关
This commit is contained in:
parent
4918552492
commit
1644070e97
@ -30,3 +30,4 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
||||
|
||||
# websocket 开关 默认使用sse推送
|
||||
VITE_APP_WEBSOCKET = false
|
||||
VITE_APP_SSE = true
|
||||
|
@ -33,3 +33,4 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
||||
|
||||
# websocket 开关 默认使用sse推送
|
||||
VITE_APP_WEBSOCKET = false
|
||||
VITE_APP_SSE = true
|
||||
|
@ -4,6 +4,10 @@ import useNoticeStore from '@/store/modules/notice';
|
||||
|
||||
// 初始化
|
||||
export const initSSE = (url: any) => {
|
||||
if (import.meta.env.VITE_APP_SSE === 'false') {
|
||||
return;
|
||||
}
|
||||
|
||||
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
|
||||
const {
|
||||
data,
|
||||
|
Loading…
x
Reference in New Issue
Block a user