/**
* 生成6位随机字符串
* @returns
*/
const randomCode = () => {
let character = ''
let len = 6; // 选择的生成的位数
let code = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASFGHJKLZXCVBNM'
let maxPos = code.length;
for (let i = 0; i < len; i++) {
character += code.charAt(Math.floor(Math.random() * maxPos))
}
return character
}
评论 (0)