Browse Source

fix(#6080): 头像上传更新后头像不更新,使用 ?? 替代 || 修复空字符串判断

ethanfly 2 weeks ago
parent
commit
47f3d5d9d5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      client/src/views/Profile/index.vue

+ 1 - 1
client/src/views/Profile/index.vue

@@ -6,7 +6,7 @@
       <el-col :span="8">
         <div class="page-card profile-card">
           <div class="avatar-section">
-            <el-avatar :size="100" :src="authStore.user?.avatarUrl || undefined">
+            <el-avatar :size="100" :src="authStore.user?.avatarUrl ?? undefined">
               {{ authStore.user?.nickname?.[0] || authStore.user?.username?.[0] }}
             </el-avatar>
             <el-upload