| | |
| | | else if (event === 'test-status' && data && typeof data === 'object' && 'testStatus' in data && liveState.value) |
| | | applyLiveState({ ...liveState.value, testStatus: (data as { testStatus: TestLiveState['testStatus'] }).testStatus }) |
| | | else if (event === 'exception' && Array.isArray(data) && liveState.value) { |
| | | liveState.value = { ...liveState.value, exceptions: data as TestLiveState['exceptions'] } |
| | | liveError.value = data.length ? '检测来源存在异常' : '' |
| | | const current = (data as TestLiveState['exceptions']).filter(item => !item.status || item.status === 'OPEN') |
| | | liveState.value = { ...liveState.value, exceptions: current } |
| | | liveError.value = current.length ? '检测来源存在异常' : '' |
| | | } |
| | | }, error => { |
| | | liveConnection.value = error.message.includes('权限') ? '权限不足' : '已断开' |