diff --git a/src/views/CompanyRecruitment/Appointment.vue b/src/views/CompanyRecruitment/Appointment.vue index 371580de3df149aa25a7a0e79b78ca8116d524e6..7f89c5da6a65dc2649f1ff011ca0211ef8add571 100644 --- a/src/views/CompanyRecruitment/Appointment.vue +++ b/src/views/CompanyRecruitment/Appointment.vue @@ -381,6 +381,21 @@ export default { this.getCompanyRecruitment() const data = respone.data const flag = data.code + + //面试房间号 + let number = '';//声明一个空的字符串值用于后面赋值 + const codeLength = 4; //验证码的长度,可以根据个人需求改变 + const random = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' + ]; //随机数的取值范围 + for (let i = 0; i < codeLength; i++) { + //循环遍历codeLength,值是几,就循环几次 + let index = Math.floor(Math.random() * 36); //Math.floor方法用于返回小于或等于一个给定数字的最大整数;Math.random方法返回 0(含)和 1(不含)之间的随机数 + number += random[index]; //根据索引取得随机数加到code上 + } + this.temp.collected = number; + console.log("code:" + number) + this.$notify({ title: '提示', message: data.desc,