mirror of
https://github.com/yinxin630/fiora.git
synced 2026-06-04 21:03:18 +08:00
* Refactor as monorepo * Fix server * Fix client * Fix not fire message event error * Fix CI scripts * Update install doc * Fix bin * Refactored the directory structure to the final version * Fix ts type error * Fix lint error * Fix unit test error * Update .gitignore
18 lines
369 B
TypeScript
18 lines
369 B
TypeScript
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`;
|
|
}
|