UPDATE: 异步导出检测数据逻辑。
This commit is contained in:
@@ -211,13 +211,19 @@ class RequestHttp {
|
||||
const eventSource = new EventSourcePolyfill(requestUrl, {
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + userStore.accessToken
|
||||
}
|
||||
},
|
||||
// 增加超时时间到120秒
|
||||
heartbeatTimeout: 120000
|
||||
})
|
||||
|
||||
// 设置默认的Authorization头部
|
||||
eventSource.addEventListener('open', function () {
|
||||
console.log('SSE连接已建立')
|
||||
})
|
||||
// 添加错误处理
|
||||
eventSource.addEventListener('error', function (err) {
|
||||
console.error('SSE连接错误:', err)
|
||||
})
|
||||
|
||||
return eventSource
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ export const importSubPlan = (params: Plan.ResPlan) => {
|
||||
|
||||
// 导出计划检测结果数据
|
||||
export const exportPlanCheckData = (params: any) => {
|
||||
return http.download(
|
||||
return http.post(
|
||||
`/adPlan/exportPlanCheckData?planId=${params.id}&devIds=${params.devIds}&report=${params.report}`
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user