mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-15 05:03:44 +08:00
refactor(projects): 细节完善
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user