fix: 姓名去識別化

This commit is contained in:
skytek_xinliang
2026-09-29 10:08:42 +08:00
parent 86ffaf54be
commit 4f241e2235
3 changed files with 21 additions and 18 deletions
@@ -41,16 +41,19 @@
<v-list-item v-if="store.isLoggedIn" class="py-4 bg-primary text-white">
<template #prepend>
<v-avatar color="accent" size="48">
<span class="text-white font-weight-bold text-h6">
{{ (store.userProfile.name || "姓名").substring(0, 1) }}
</span>
<svg
aria-hidden="true"
class="profile-avatar-icon"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M11.518,12.629l.559,.377c1.134-.847,6.754-4.326,7-8.706,0-2.371-1.794-4.3-4-4.3-1.193,0-2.267,.565-3,1.458-.733-.894-1.807-1.458-3-1.458-2.206,0-4,1.929-4,4.3,0,3.876,5.782,7.885,6.441,8.329ZM9.077,2c1.103,0,2,1.032,2,2.3h2c0-1.268,.897-2.3,2-2.3s2,1.032,2,2.3c0,1.948-2.864,4.71-4.998,6.275-1.732-1.286-5.002-4.147-5.002-6.275,0-1.268,.897-2.3,2-2.3Zm14.923,17h-1v3h-2V14h2v3h1v2Zm-6-7h2v12h-2v-5H6v5h-2V12h2v5h12v-5ZM1,14H3v8H1v-3H0v-2H1v-3Z"
/>
</svg>
</v-avatar>
</template>
<v-list-item-title class="font-weight-bold">
{{ displayUserName }}
</v-list-item-title>
<v-list-item-subtitle class="text-white-50">{{
store.userProfile.phone
}}</v-list-item-subtitle>
@@ -100,14 +103,14 @@
to="/"
/>
<v-list-item
<!-- <v-list-item
v-if="store.isLoggedIn"
color="primary"
prepend-icon="mdi-account-edit"
title="個人資料修改"
to="/profile"
@click="drawer = false"
/>
/> -->
<v-list-item
v-if="SELF_ASSESSMENT_ENABLED"
@@ -297,7 +300,6 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useDisplayUserName } from "@/composables/useDisplayUserName";
import {
APPOINTMENT_ENABLED,
BODY_COMPOSITION_ENABLED,
@@ -312,7 +314,6 @@ const store = useAppStore();
const courseStore = useCourseStore();
const router = useRouter();
const route = useRoute();
const displayUserName = useDisplayUserName(store.userProfile);
const drawer = ref(false);
const activeTab = ref("home");
@@ -388,4 +389,11 @@ async function handleLogout() {
.border-top {
border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.profile-avatar-icon {
width: 28px;
height: 28px;
color: white;
fill: currentcolor;
}
</style>