标签:
js生成6位随机数字:
let chars = ‘0123456789‘; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ let maxPos = chars.length; let code = ‘‘; for (let i = 0; i < 6; i++) { code += chars.charAt(Math.floor(Math.random() * maxPos)); } return code; //直接转换为小写
标签:
原文地址:http://www.cnblogs.com/caiya928/p/5579571.html