日志按时间戳正序排序
This commit is contained in:
parent
fa9f64d28b
commit
d9608d5bd6
@ -135,6 +135,7 @@ export default {
|
||||
this.fromIndex = res.data.fromIndex
|
||||
if (res.data.message) {
|
||||
this.logList.push(...res.data.message)
|
||||
this.logList.sort((a, b) => a.time_stamp - b.time_stamp)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@ -153,7 +154,7 @@ export default {
|
||||
const hours = date.getHours()
|
||||
const minutes = date.getMinutes().toString().length === 1 ? '0' + date.getMinutes() : date.getMinutes().toString()
|
||||
const seconds = date.getSeconds().toString().length === 1 ? '0' + date.getSeconds() : date.getSeconds().toString()
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${date.getMilliseconds()}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user