(ts)
| 40 | return out + units[index]; |
| 41 | } |
| 42 | function humanAgo(ts){ |
| 43 | if(!ts) return '-'; |
| 44 | const sec = Math.max(0, Math.floor(Date.now() / 1000 - Number(ts))); |
| 45 | if(sec < 60) return '几秒前'; |
| 46 | const min = Math.floor(sec / 60); |
| 47 | if(min < 60) return `${min} 分钟前`; |
| 48 | return `${Math.floor(min / 60)} 小时前`; |
| 49 | } |
| 50 | |
| 51 | function osClass(os){ |
| 52 | if(!os) return ''; |