mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-11 04:39:35 +08:00
fix: 修复瞬间视频可同时播放多个视频bug、优化列表加载
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
/**
|
||||
* 生成指定长度的uuid
|
||||
* @param {number} = 长度
|
||||
*/
|
||||
export function generateUUID(length = 36) {
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let result = '';
|
||||
|
||||
const validLength = Math.max(1, Math.floor(Number(length)) || 36);
|
||||
for (let i = 0; i < validLength; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user