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>
+1 -3
View File
@@ -9,7 +9,7 @@
<v-row class="mt-4 pa-2" no-gutters>
<v-col :cols="courseStore.groupMissing ? 8 : 12">
<v-card-title>
{{ displayUserName }}
{{ store.userProfile.phone }}
</v-card-title>
<v-card-subtitle>
資料更新於 {{ todayTimeString }}
@@ -383,7 +383,6 @@ import Layout from "@/components/layout/DefaultLayout.vue";
import ModuleRouterCard from "@/components/ModuleRouterCard.vue";
import PlatformIntroduction from "@/components/PlatformIntroduction.vue";
import PhysicalFitnessSummary from "@/components/PhysicalFitnessSummary.vue";
import { useDisplayUserName } from "@/composables/useDisplayUserName";
import {
APPOINTMENT_ENABLED,
BODY_COMPOSITION_ENABLED,
@@ -409,7 +408,6 @@ const physicalFitnessReceivedAt = ref<string | null>(null);
const physicalFitnessLoading = ref(false);
const physicalFitnessError = ref("");
const displayUserName = useDisplayUserName(store.userProfile);
const physicalFitnessRadarData = computed(() =>
calculatePhysicalFitnessRadar(physicalFitnessItems.value),
);
+1 -4
View File
@@ -6,7 +6,6 @@ import CheckinDetail from "@/pages/checkinDetail.vue";
import Course from "@/pages/course.vue";
import Index from "@/pages/index.vue";
import Login from "@/pages/login.vue";
import Profile from "@/pages/profile.vue";
import Register from "@/pages/register.vue";
import SelfAssessment from "@/pages/self-assessment.vue";
import {
@@ -55,9 +54,7 @@ const router = createRouter({
},
{
path: "/profile",
name: "profile",
component: Profile,
meta: { requiresAuth: true, title: "個人資料修改|運動玩轉健康力" },
redirect: { name: "home" },
},
{
path: "/body-composition",