mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2025-10-15 14:20:30 +00:00
update 优化 sse重试改为5次 避免掉线频繁连接
This commit is contained in:
@@ -11,10 +11,10 @@ export const initSSE = (url: any) => {
|
||||
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
|
||||
const { data, error } = useEventSource(url, [], {
|
||||
autoReconnect: {
|
||||
retries: 10,
|
||||
delay: 3000,
|
||||
retries: 5,
|
||||
delay: 5000,
|
||||
onFailed() {
|
||||
console.log('Failed to connect after 10 retries');
|
||||
console.log('Failed to connect after 5 retries');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user