chore:改了头像的地址

This commit is contained in:
2026-04-20 15:44:58 +08:00
parent 7675e8e04d
commit d8b78168a8
4 changed files with 25 additions and 11 deletions

View File

@@ -353,6 +353,7 @@
</template>
<script>
import aiService from '@/common/js/ai-service.js'
import IMAGE_CONFIG from '@/common/js/image-config.js'
export default {
name: 'ai-chat-message',
@@ -411,20 +412,13 @@ export default {
streamInterval: null,
streamContent: '',
isStreaming: false,
// 固定AI头像
aiAvatar: '/static/images/image_680328925892268.png',
// 本地用户头像(优先使用缓存,无缓存则用默认图)
localUserAvatar: '',
// 默认头像路径
defaultAvatar: '/static/images/user-avatar.png',
showAvatarSelector: false, // 头像选择弹窗控制
localUserNickname: '', // 当前用户昵称
defaultNickname: '我', // 默认昵称
showNicknameEditor: false, // 昵称编辑弹窗控制
tempNickname: '', // 昵称编辑临时值
// 1. 使用图片URL:设置为图片链接字符串
// 2. 使用emoji:设置为空字符串或null,将显示默认的🤖
aiAvatarUrl: '/static/images/image_680328925892268.png',
// AI头像错误状态
avatarError: false,
@@ -439,6 +433,17 @@ export default {
historyOffset: 0,
isFetchingHistory: false
}
},
computed: {
aiAvatar() {
return this.$util.img(IMAGE_CONFIG.aiAvatar);
},
defaultAvatar() {
return this.$util.img(IMAGE_CONFIG.userAvatar);
},
aiAvatarUrl() {
return this.$util.img(IMAGE_CONFIG.aiAvatar);
}
},
onShow() {
// 如果不是 AI 客服,立即退出并跳转

View File

@@ -79,6 +79,7 @@ import { mapGetters, mapMutations } from 'vuex'
import navigationHelper from '@/common/js/navigation';
import { EventSafety } from '@/common/js/event-safety';
import aiChatMessage from './ai-chat-message.vue';
import IMAGE_CONFIG from '@/common/js/image-config.js';
export default {
components: {
@@ -121,10 +122,10 @@ export default {
/// ---- 关于AI客服的配置,支持远程配置 ----
userAvatar() {
return this.globalAIKefuConfig?.userAvatar || '/static/images/user-avatar.png'
return this.globalAIKefuConfig?.userAvatar || this.$util.img(IMAGE_CONFIG.userAvatar)
},
aiAvatar() {
return this.globalAIKefuConfig?.aiAvatar || '/static/images/ai-avatar.png'
return this.globalAIKefuConfig?.aiAvatar || this.$util.img(IMAGE_CONFIG.aiAvatar)
},
/// ---- others ----
containerHeight() {