审计日志并入系统管理、规范项目成员获取逻辑

This commit is contained in:
Cheng Zhou
2025-12-26 14:57:57 +08:00
parent 7c9befc3c9
commit 71db309e12
17 changed files with 94 additions and 116 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ import { ElMessage } from "element-plus";
import { fetchComments, createComment } from "../api/comments";
import { useStudyStore } from "../store/study";
import { listMembers } from "../api/members";
import { displayDateTime, displayUser } from "../utils/display";
import { displayDateTime, displayUser, getMemberDisplayName } from "../utils/display";
interface Props {
studyId: string;
@@ -72,8 +72,8 @@ const loadMembers = async () => {
const memberMap = computed(() =>
members.value.reduce<Record<string, string>>((acc, cur) => {
const username = cur?.user?.display_name || cur?.user?.username || cur?.username;
if (cur?.user_id) acc[cur.user_id] = username || cur.user_id;
const username = getMemberDisplayName(cur);
if (cur?.user_id && username) acc[cur.user_id] = username;
return acc;
}, {})
);