diff --git a/admin/dashboard/templates/wx_logs.html b/admin/dashboard/templates/wx_logs.html index 4fb0687..363cbd1 100644 --- a/admin/dashboard/templates/wx_logs.html +++ b/admin/dashboard/templates/wx_logs.html @@ -38,11 +38,13 @@ 自动滚动到底部
+ {% raw %}
{{ formatTimestamp(log.timestamp) }} {{ log.level }} {{ log.message }}
+ {% endraw %}
@@ -101,15 +103,16 @@ this.filteredLogs = this.logContent; } else { const query = this.searchQuery.toLowerCase(); - this.filteredLogs = this.logContent.filter(log => - log.message.toLowerCase().includes(query) || - log.level.toLowerCase().includes(query) || - log.timestamp.toLowerCase().includes(query) + this.filteredLogs = this.logContent.filter(log => + (log.message && log.message.toLowerCase().includes(query)) || + (log.level && log.level.toLowerCase().includes(query)) || + (log.timestamp && log.timestamp.toLowerCase().includes(query)) ); } this.$nextTick(() => this.scrollToBottom()); }, formatTimestamp(timestamp) { + if (!timestamp) return ''; return new Date(timestamp).toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit'