//倒计时时间 export const countDownTime = 60; // 区号下拉 export const countryCodeOptios = [ { label: "+86", value: 86 }, { label: "+852", value: 852 }, { label: "+853", value: 853 }, { label: "+886", value: 886 }, ]; //密码强度类型 export const passStrengthOptions = [ { level: 0, txt: "太弱", color: "#000000", remarks: "请至少输入6位长度的密码。请不要使用容易被猜到的密码。", }, { level: 20, txt: "弱", color: "#FF2500", remarks: "密码设置的强度较弱。请不要使用容易被猜到的密码。", }, { level: 50, txt: "中", color: "#FF9400", remarks: "密码设置的强度较强。请不要使用容易被猜到的密码。", }, { level: 100, txt: "强", color: "#52C41A", remarks: "密码设置的强度很强。请不要使用容易被猜到的密码。", }, ]; // 判断密码强度 export const verifyPasswordStrong = (sValue) => { var modes = 0; //正则表达式验证符合要求的 if (sValue.length < 6) return passStrengthOptions[modes]; if (/\d/.test(sValue)) modes++; //数字 if (/[a-z]/.test(sValue)) modes++; //小写 if (/[A-Z]/.test(sValue)) modes++; //大写 if (/\W/.test(sValue)) modes++; //特殊字符 //逻辑处理 switch (modes) { case 1: modes = 1; break; case 2: modes = 2; break; case 3: modes = 2; break; case 4: modes = sValue.length < 10 ? 2 : 3; break; } return passStrengthOptions[modes]; };