Skip to content

Commit

Permalink
, TotalFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartSchoolAI committed Jun 2, 2024
1 parent 913bc6e commit 2538953
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion express/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export async function wholeSiteStatics() {
const Records3 = await (getDbRecord)("SELECT COUNT(*) AS NUM from user");
const TotalUsers = Records3 ? Records3.NUM : 0;

return {NewUserPerDay, NewImagesPerDay, NewActivitesPerDay, DateList, TotalImages, TotalActivites, TotalUsers, TotalFiles}
return {NewUserPerDay, NewImagesPerDay, NewActivitesPerDay, DateList, TotalImages, TotalActivites, TotalUsers}
}

export async function getAllImages(userId, pageid, pagesize) {
Expand Down
12 changes: 12 additions & 0 deletions src/functions/ChatBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,16 @@ export function downloadJson(JsonData: any, FileName: string) {
a.download = FileName + '.json';
a.click();
URL.revokeObjectURL(url);
}

export function AppAvatar(backEndApiChatBook: string, avatar: string) {
console.log("backEndApiChatBook", avatar)
if(avatar.startsWith('http')) {

return avatar
}
else {

return backEndApiChatBook + '/api/avatarforapp/' + avatar
}
}
4 changes: 3 additions & 1 deletion src/views/app/all/AppModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import Icon from 'src/@core/components/icon'

import { useTranslation } from 'react-i18next'

import { AppAvatar } from 'src/functions/ChatBook'


const AppModel = (props: any) => {
// ** Hook
Expand Down Expand Up @@ -65,7 +67,7 @@ const AppModel = (props: any) => {
sx={{cursor: 'pointer'}}
>
<Box display="flex" alignItems="center">
<Avatar src={authConfig.backEndApiChatBook + '/api/avatarforapp/' + item.avatar} sx={{ mr: 3, width: 35, height: 35 }} />
<Avatar src={AppAvatar(authConfig.backEndApiChatBook, item.avatar)} sx={{ mr: 3, width: 35, height: 35 }} />
<Typography
sx={{
fontWeight: 500,
Expand Down

0 comments on commit 2538953

Please sign in to comment.