fix: 搜索接口后端关闭连接时会触发 error 事件,前端需要手动调用 close 不再自动重连

This commit is contained in:
zthxxx
2023-09-08 13:24:59 +08:00
parent ef19f4ed07
commit bec27b29e6
2 changed files with 9 additions and 7 deletions

View File

@@ -27,6 +27,8 @@ export const apiSearch = {
eventSource.onerror = ev => {
console.error('[/search/bangumi] Server Error |', { keyword }, 'error:', ev)
// 目前后端搜索完成关闭连接时会触发 error 事件,前端手动调用 close 不再自动重连
eventSource.close();
};
return () => {