fix: 日志系统修复

- userId 延迟到 finish 事件获取(authMiddleware 已执行)
- 日志记录 UTC 时间戳,支持前端按用户时区显示
- 日期筛选和级别筛选 watch 监听修复
- 添加 showDatePicker 变量定义
This commit is contained in:
2026-06-08 15:06:29 +08:00
parent 860c599b7c
commit 162f2dc89c
2 changed files with 13 additions and 7 deletions

View File

@@ -109,6 +109,7 @@ const logLines = ref<string[]>([])
const loading = ref(false)
const page = ref(1)
const total = ref(0)
const showDatePicker = ref(false)
const noMore = computed(() => logLines.value.length >= total.value && total.value > 0)
@@ -173,6 +174,7 @@ function loadMore() {
function selectDate(date: string) {
selectedDate.value = date
page.value = 1
loadLogs()
}
@@ -189,7 +191,10 @@ function getLineClass(line: string): string {
}
// 筛选条件变化时重新加载
watch([filterLevel], () => loadLogs())
watch([filterLevel, selectedDate], () => {
page.value = 1
loadLogs()
})
function goBack() {
uni.navigateBack()