From c38496b87f741d984f1f7bebe6e75e6abe5e7c51 Mon Sep 17 00:00:00 2001 From: fiaohe <2803383797@qq.com> Date: Wed, 7 Jun 2023 16:10:22 +0000 Subject: [PATCH] update src/views/CompanyRecruitment/Appointment.vue. Signed-off-by: fiaohe <2803383797@qq.com> --- src/views/CompanyRecruitment/Appointment.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/views/CompanyRecruitment/Appointment.vue b/src/views/CompanyRecruitment/Appointment.vue index 371580d..7f89c5d 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, -- Gitee