fix:更改系统回答头像
This commit is contained in:
parent
1b788f1a5c
commit
fe5b055663
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
|
|
@ -19,12 +19,7 @@ const navItems = computed(() =>
|
||||||
)
|
)
|
||||||
|
|
||||||
const displayName = computed(() => store.currentUser?.name || '未登录')
|
const displayName = computed(() => store.currentUser?.name || '未登录')
|
||||||
const roleLabel = computed(() => {
|
const unitLabel = computed(() => store.currentUser?.unit_name || '')
|
||||||
const roles = store.currentUser?.roles || []
|
|
||||||
if (!roles.length) return ''
|
|
||||||
if (roles.includes('admin') || store.currentUser?.is_superuser) return '管理员'
|
|
||||||
return roles[0]
|
|
||||||
})
|
|
||||||
const avatarInitial = computed(() => (displayName.value || '?')[0].toUpperCase())
|
const avatarInitial = computed(() => (displayName.value || '?')[0].toUpperCase())
|
||||||
|
|
||||||
async function onLogout() {
|
async function onLogout() {
|
||||||
|
|
@ -67,7 +62,7 @@ async function onLogout() {
|
||||||
<div class="sidebar-user-avatar">{{ avatarInitial }}</div>
|
<div class="sidebar-user-avatar">{{ avatarInitial }}</div>
|
||||||
<div class="sidebar-user-info">
|
<div class="sidebar-user-info">
|
||||||
<div class="sidebar-user-name">{{ displayName }}</div>
|
<div class="sidebar-user-name">{{ displayName }}</div>
|
||||||
<span v-if="roleLabel" class="sidebar-user-role">{{ roleLabel }}</span>
|
<span v-if="unitLabel" class="sidebar-user-role">{{ unitLabel }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="sidebar-user-menu" type="button" title="更多">⋯</button>
|
<button class="sidebar-user-menu" type="button" title="更多">⋯</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1129,8 +1129,17 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg-avatar.assistant {
|
.msg-avatar.assistant {
|
||||||
background: linear-gradient(135deg, #ff8a8a 0%, #e63946 100%);
|
background: #fff;
|
||||||
box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
|
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 {
|
.msg-avatar.user {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { computed, nextTick, onMounted, ref, watch } from 'vue'
|
||||||
import { useChat } from '@/composables/useChat'
|
import { useChat } from '@/composables/useChat'
|
||||||
import { useAppStore } from '@/stores/app'
|
import { useAppStore } from '@/stores/app'
|
||||||
import { renderMarkdown } from '@/utils/markdown'
|
import { renderMarkdown } from '@/utils/markdown'
|
||||||
|
import assistantAvatar from '@/assets/sysA.jpeg'
|
||||||
|
|
||||||
const store = useAppStore()
|
const store = useAppStore()
|
||||||
const {
|
const {
|
||||||
|
|
@ -266,7 +267,9 @@ watch(messages, scrollToEnd, { deep: true })
|
||||||
class="message"
|
class="message"
|
||||||
:class="msg.role"
|
:class="msg.role"
|
||||||
>
|
>
|
||||||
<div v-if="msg.role === 'assistant'" class="msg-avatar assistant">✦</div>
|
<div v-if="msg.role === 'assistant'" class="msg-avatar assistant">
|
||||||
|
<img :src="assistantAvatar" alt="AI助手" />
|
||||||
|
</div>
|
||||||
<div class="bubble-col">
|
<div class="bubble-col">
|
||||||
<div class="bubble">
|
<div class="bubble">
|
||||||
<template v-if="msg.role === 'user'">
|
<template v-if="msg.role === 'user'">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue