From c02207ba2ef96d8c9f5f33427b5dd2c00aa343e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=82=E9=BB=8E?= <329261568@qq.com> Date: Mon, 13 Nov 2023 14:36:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=9B=BA?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=94=B9=E4=B8=AD=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/ota/index.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/iot/ota/index.vue b/src/views/iot/ota/index.vue index 54f3a4ef..f3a4c9aa 100644 --- a/src/views/iot/ota/index.vue +++ b/src/views/iot/ota/index.vue @@ -449,17 +449,16 @@ export default { }, methods: { chenking_otaVersion(rule, value, callback){ - const regex = /^\d+(\.\d+)*$/; + const regex = /^(\d{1,3}\.){3}\d{1,3}$/; if (!this.form.otaVersion) { callback(new Error('版本不能为空')) } else if(!regex.test(this.form.otaVersion)) { - callback(new Error('版本格式不正确: x.x.x.x (如1.0.05.121)')) + callback(new Error('版本格式不正确: x.x.x.x (如: 0~999.0~999.0~999.0~999)')) } else { callback(); } }, beforeAvatarUpload(file) { - console.log('oat-upload-file--', file, file.type === 'application/octet-stream'); const isBin = file.type === 'application/octet-stream'; if (!isBin) { this.$message.error('上传文件类型错误,只能上传.bin文件!'); @@ -496,7 +495,6 @@ export default { this.handleQuery(); }, uploud(file) { - console.log(file); var formData = new FormData(); var that = this; formData.append("file", file.file);