refactor(projects): 细节完善

This commit is contained in:
Soybean
2022-01-24 00:00:59 +08:00
parent b61b0ce25f
commit 651e58dcb6
14 changed files with 1021 additions and 159 deletions

View File

@@ -21,3 +21,14 @@ export function transformToTimeCountDown(seconds: number) {
const second = fillZero(seconds - minuteNum * SECONDS_A_MINUTE);
return `${minute}: ${second}`;
}
/**
* 获取指定整数范围内的随机整数
* @param start - 开始范围
* @param end - 结束范围
*/
export function getRandomInterger(end: number, start: number = 0) {
const range = end - start;
const random = Math.floor(Math.random() * range + start);
return random;
}