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);