Преглед на файлове

fix(editor): 从localStorage获取用户名显示在欢迎页

何文松 преди 3 седмици
родител
ревизия
97561553e9
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      frontend/vue-demo/src/views/Editor.vue

+ 1 - 1
frontend/vue-demo/src/views/Editor.vue

@@ -597,7 +597,7 @@ const currentReportId = ref(null)
 const hasActiveDocument = computed(() => !!currentDocumentId.value)
 
 // 欢迎页问候语
-const userName = ref('用户')  // TODO: 从用户信息获取
+const userName = computed(() => localStorage.getItem('username') || '用户')
 const greetingText = computed(() => {
   const hour = new Date().getHours()
   if (hour < 6) return '凌晨好'