修复访问日志耗时可能显示NaN的Bug

This commit is contained in:
刘祥超
2022-04-21 09:41:59 +08:00
parent f0dfab536c
commit 68514bc7ed

View File

@@ -16,13 +16,16 @@ Vue.component("http-access-log-box", {
}, },
methods: { methods: {
formatCost: function (seconds) { formatCost: function (seconds) {
var s = (seconds * 1000).toString(); if (seconds == null) {
var pieces = s.split("."); return "0"
}
let s = (seconds * 1000).toString();
let pieces = s.split(".");
if (pieces.length < 2) { if (pieces.length < 2) {
return s; return s;
} }
return pieces[0] + "." + pieces[1].substr(0, 3); return pieces[0] + "." + pieces[1].substring(0, 3);
}, },
showLog: function () { showLog: function () {
let that = this let that = this