From 96dc2c7c689eb5845489414eef3e0e6c5e3ef090 Mon Sep 17 00:00:00 2001 From: ChatBookAI Date: Sun, 2 Jun 2024 15:07:44 +0800 Subject: [PATCH] AppAvatar --- src/functions/ChatBook.ts | 1 - src/views/app/chat/ChatContent.tsx | 3 ++- src/views/app/chat/ChatLog.tsx | 3 ++- src/views/app/edit/SimpleEdit.tsx | 3 ++- src/views/app/my/MyAppModel.tsx | 3 ++- src/views/system/applications/Applications.tsx | 3 ++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/functions/ChatBook.ts b/src/functions/ChatBook.ts index 1f174b8f..f547a89d 100644 --- a/src/functions/ChatBook.ts +++ b/src/functions/ChatBook.ts @@ -611,7 +611,6 @@ export function downloadJson(JsonData: any, FileName: string) { } export function AppAvatar(backEndApiChatBook: string, avatar: string) { - console.log("backEndApiChatBook", avatar) if(avatar.startsWith('http')) { return avatar diff --git a/src/views/app/chat/ChatContent.tsx b/src/views/app/chat/ChatContent.tsx index da45bdbc..dec4b22a 100644 --- a/src/views/app/chat/ChatContent.tsx +++ b/src/views/app/chat/ChatContent.tsx @@ -13,6 +13,7 @@ import authConfig from 'src/configs/auth' import ChatLog from './ChatLog' import { useTranslation } from 'react-i18next' import SendMsgForm from 'src/views/app/chat/SendMsgForm' +import { AppAvatar } from 'src/functions/ChatBook' const ChatContent = (props: any) => { // ** Props @@ -93,7 +94,7 @@ const ChatContent = (props: any) => { } > diff --git a/src/views/app/chat/ChatLog.tsx b/src/views/app/chat/ChatLog.tsx index 5ec0c7bc..36765e71 100644 --- a/src/views/app/chat/ChatLog.tsx +++ b/src/views/app/chat/ChatLog.tsx @@ -32,6 +32,7 @@ import PerfectScrollbarComponent, { ScrollBarProps } from 'react-perfect-scrollb // ** Custom Components Imports import CustomAvatar from 'src/@core/components/mui/avatar' +import { AppAvatar } from 'src/functions/ChatBook' // ** Types Imports import { @@ -337,7 +338,7 @@ const ChatLog = (props: any) => { fontSize: '0.875rem', }} {...{ - src: app.avatar? authConfig.backEndApiChatBook + '/api/avatarforapp/' + app.avatar : '/images/avatars/1.png', + src: app.avatar? AppAvatar(authConfig.backEndApiChatBook, app.avatar) : '/images/avatars/1.png', alt: chatName }} > diff --git a/src/views/app/edit/SimpleEdit.tsx b/src/views/app/edit/SimpleEdit.tsx index f58406bd..21f756c9 100644 --- a/src/views/app/edit/SimpleEdit.tsx +++ b/src/views/app/edit/SimpleEdit.tsx @@ -19,6 +19,7 @@ import authConfig from 'src/configs/auth' // ** Axios Imports import { useRouter } from 'next/router' +import { AppAvatar } from 'src/functions/ChatBook' // ** Icon Imports import Icon from 'src/@core/components/icon' @@ -126,7 +127,7 @@ const SimpleEdit = (props: any) => { ) : ( - {`${t(`Upload + {`${t(`Upload )} diff --git a/src/views/app/my/MyAppModel.tsx b/src/views/app/my/MyAppModel.tsx index 9dbf8943..3843cd7c 100644 --- a/src/views/app/my/MyAppModel.tsx +++ b/src/views/app/my/MyAppModel.tsx @@ -26,6 +26,7 @@ import { useRouter } from 'next/router' import Icon from 'src/@core/components/icon' import { useTranslation } from 'react-i18next' +import { AppAvatar } from 'src/functions/ChatBook' const AppModel = (props: any) => { @@ -144,7 +145,7 @@ const AppModel = (props: any) => { sx={{cursor: 'pointer'}} > - + { filterable: false, renderCell: ({ row }: any) => { return ( - + ) } },