调整SSE心跳时间
优化全局环境配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API='/api'
|
VITE_APP_BASE_API=/api
|
||||||
|
|
||||||
|
|
||||||
VITE_APP_BASE_URL='http://192.168.1.38:18081'
|
VITE_APP_BASE_URL=http://192.168.1.38:18081
|
||||||
@@ -12,7 +12,7 @@ interface EventData {
|
|||||||
code: 200 | 201 | 300 | 400 | 500;
|
code: 200 | 201 | 300 | 400 | 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface logItem {
|
export interface logItem {
|
||||||
message: string;
|
message: string;
|
||||||
type?: "success" | "error" | "log";
|
type?: "success" | "error" | "log";
|
||||||
}
|
}
|
||||||
@@ -128,8 +128,9 @@ export function useSSE(options: SSEOptions) {
|
|||||||
// 创建EventSource
|
// 创建EventSource
|
||||||
const eventSourceOptions = {
|
const eventSourceOptions = {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${getToken()}`,
|
Authorization: `Bearer ${getToken()}`,
|
||||||
}
|
},
|
||||||
|
heartbeatTimeout: 90 * 60 * 1000,
|
||||||
};
|
};
|
||||||
eventSource = new EventSourcePolyfill(connectUrl, eventSourceOptions);
|
eventSource = new EventSourcePolyfill(connectUrl, eventSourceOptions);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user