From 93e6b297189f701282b290f79f15c62009f342be Mon Sep 17 00:00:00 2001 From: Jack Shao Date: Fri, 26 Feb 2021 11:55:19 +0800 Subject: [PATCH] fix: fix the validation condition for char addr --- package.json | 2 +- src/views/Settings.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8a25c9d..a229df5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sensecap_one_cfg_tool", - "version": "1.1.0", + "version": "1.1.1", "private": true, "description": "SenseCAP One Configuration Tool", "author": "Jack Shao ", diff --git a/src/views/Settings.vue b/src/views/Settings.vue index df8b179..b434bad 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -649,7 +649,7 @@ export default { data() { let rules = { required: {required: true, message: this.$t("Required."), trigger: 'blur'}, - charAddr: {type: 'string', required: true, pattern: /[0-9a-zA-Z]{1}/, message: this.$t("Invalid Address."), trigger: 'blur'}, + charAddr: {type: 'string', required: true, pattern: /^[0-9a-zA-Z]{1}$/, message: this.$t("Invalid Address."), trigger: 'blur'}, mbAddr: {type: 'number', min: 1, max: 247, message: this.$t("Invalid Modbus Address."), trigger: 'blur'}, deviceName: {type: 'string', min: 1, max: 64, message: this.$t("Invalid Device Name."), trigger: 'blur'}, rng10_100: {type: 'number', min: 10, max: 100, message: this.$t("Invalid Number."), trigger: 'blur'},