generateRandomID() {
const characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const idLength = 30; // 字符串长度 这里生成30位的
let randomID = '';
for (let i = 0; i < idLength; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
randomID += characters.charAt(randomIndex);
}
return randomID;
},
控制台打印出来: