chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const AvatarCount = 15;
|
||||
const publicPath = process.env.PublicPath || '/';
|
||||
|
||||
/**
|
||||
* 获取随机头像
|
||||
*/
|
||||
export default function getRandomAvatar() {
|
||||
const number = Math.floor(Math.random() * AvatarCount);
|
||||
return `${publicPath}avatar/${number}.jpg`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认头像
|
||||
*/
|
||||
export function getDefaultAvatar() {
|
||||
return `${publicPath}avatar/0.jpg`;
|
||||
}
|
||||
Reference in New Issue
Block a user