[2022-03-30T15:37:24.924] [INFO] info - get deptnum
[2022-03-30T15:37:24.930] [INFO] info - get air
[2022-03-30T15:37:25.001] [INFO] info - get cloud_netdisk
[2022-03-30T15:37:25.005] [INFO] info - get link_device_infomations
[2022-03-30T15:37:25.016] [INFO] info - get ratio
[2022-03-30T15:37:26.866] [INFO] info - get deptnum
[2022-03-30T15:37:26.873] [INFO] info - get air
[2022-03-30T15:37:26.933] [INFO] info - get ratio
[2022-03-30T15:37:26.933] [INFO] info - get link_device_infomations
[2022-03-30T15:37:26.935] [INFO] info - get cloud_netdisk
[2022-03-30T15:37:41.631] [ERROR] error - TypeError: Cannot read property 'forEach' of undefined
at Object.getVirusversionPC (/root/big-Screen/controller/getSecurity/getVirusversionpc.ts:15:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at /root/big-Screen/app.ts:3063:38
[2022-03-30T15:40:10.432] [ERROR] error - TypeError: Cannot read property 'forEach' of undefined
at Object.getVirusversionPC (/root/big-Screen/controller/getSecurity/getVirusversionpc.ts:15:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at /root/big-Screen/app.ts:3063:38
[2022-03-30T15:40:40.497] [ERROR] error - TypeError: Cannot read property 'forEach' of undefined
at Object.getVirusversionPC (/root/big-Screen/controller/getSecurity/getVirusversionpc.ts:15:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at /root/big-Screen/app.ts:3063:38
你这个是?
不过看报错,是说你的类别forEach 没有 定义,
去看看你相关的配置文件或者定义中,这 类别是否有正确配置
forEach遍历对象用的,遍历对象时而对象恰好又是undefined的,所以就会报这么一个错误,没有属性。
解决思路:在遍历对象之前先进行判断,判断对象是否为空,然后再去遍历该对象。