Skip to content

Commit

Permalink
perf: user default avatar (#2594)
Browse files Browse the repository at this point in the history
* perf: user default avatar

* refactor: 修改文件路径
  • Loading branch information
Patrickill authored Sep 2, 2024
1 parent 0360972 commit 5ebe001
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/service/support/user/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ import { UserStatusEnum, userStatusMap } from '@fastgpt/global/support/user/cons

export const userCollectionName = 'users';

const defaultAvatars = [
'/imgs/avatar/RoyalBlueAvatar.svg',
'/imgs/avatar/PurpleAvatar.svg',
'/imgs/avatar/AdoraAvatar.svg',
'/imgs/avatar/OrangeAvatar.svg',
'/imgs/avatar/RedAvatar.svg',
'/imgs/avatar/GrayModernAvatar.svg',
'/imgs/avatar/TealAvatar.svg',
'/imgs/avatar/GreenAvatar.svg',
'/imgs/avatar/BrightBlueAvatar.svg',
'/imgs/avatar/BlueAvatar.svg'
];

const UserSchema = new Schema({
status: {
type: String,
Expand Down Expand Up @@ -34,7 +47,7 @@ const UserSchema = new Schema({
},
avatar: {
type: String,
default: '/icon/human.svg'
default: defaultAvatars[Math.floor(Math.random() * defaultAvatars.length)]
},
inviterId: {
// 谁邀请注册的
Expand Down
Binary file added projects/app/public/imgs/avatar/AdoraAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/BlueAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/GreenAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/OrangeAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/PurpleAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/RedAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app/public/imgs/avatar/TealAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5ebe001

Please sign in to comment.