solid gray;
}
JS
// 生成验证码
createCode () {
let codeLength = 6; // 验证码长度
let codeChars = new...Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l...', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //验证码要随机挑选的字符...for (var i = 0; i < codeLength; i++) {
let charIndex = Math.floor(Math.random() * 52); // 随机产生...0-52之间的整数
this.nowCode += codeChars[charIndex];
}
},
// 切换验证码
changeCode() {
this.createCode