diff --git a/frontend/src/assets/sysA.jpeg b/frontend/src/assets/sysA.jpeg new file mode 100644 index 0000000..57eb559 Binary files /dev/null and b/frontend/src/assets/sysA.jpeg differ diff --git a/frontend/src/components/Sidebar.vue b/frontend/src/components/Sidebar.vue index 084f8f9..6d444d5 100644 --- a/frontend/src/components/Sidebar.vue +++ b/frontend/src/components/Sidebar.vue @@ -19,12 +19,7 @@ const navItems = computed(() => ) const displayName = computed(() => store.currentUser?.name || '未登录') -const roleLabel = computed(() => { - const roles = store.currentUser?.roles || [] - if (!roles.length) return '' - if (roles.includes('admin') || store.currentUser?.is_superuser) return '管理员' - return roles[0] -}) +const unitLabel = computed(() => store.currentUser?.unit_name || '') const avatarInitial = computed(() => (displayName.value || '?')[0].toUpperCase()) async function onLogout() { @@ -67,7 +62,7 @@ async function onLogout() { diff --git a/frontend/src/styles/main.css b/frontend/src/styles/main.css index 4f65aa7..6d21878 100644 --- a/frontend/src/styles/main.css +++ b/frontend/src/styles/main.css @@ -1129,8 +1129,17 @@ button { } .msg-avatar.assistant { - background: linear-gradient(135deg, #ff8a8a 0%, #e63946 100%); + background: #fff; box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3); + overflow: hidden; + padding: 0; +} + +.msg-avatar.assistant img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; } .msg-avatar.user { diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index 4d3612f..abebd0e 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -3,6 +3,7 @@ import { computed, nextTick, onMounted, ref, watch } from 'vue' import { useChat } from '@/composables/useChat' import { useAppStore } from '@/stores/app' import { renderMarkdown } from '@/utils/markdown' +import assistantAvatar from '@/assets/sysA.jpeg' const store = useAppStore() const { @@ -266,7 +267,9 @@ watch(messages, scrollToEnd, { deep: true }) class="message" :class="msg.role" > -
+
+ AI助手 +