修改在线注册的IP校验

This commit is contained in:
fangxiang 2023-02-10 16:31:39 +08:00
parent 2930add85f
commit f4b2e6cd15
1 changed files with 12 additions and 17 deletions

View File

@ -407,6 +407,7 @@ import GlobalData from "src/common/GlobalData";
import QrcodeVue from "qrcode.vue";
import { Protocol } from "src/entities/WSProtocol";
import { EDeviceAttribute } from "src/entities/EDeviceAttribute";
import ValidationUtil from "src/common/ValidationUtil";
export default defineComponent({
name: "ComponentRegisterDialog",
@ -650,7 +651,6 @@ export default defineComponent({
}
if (function_magic_wall.value) {
attribute |= EDeviceAttribute.ProductMagicWall;
}
if (function_fusion.value) {
attribute |= EDeviceAttribute.ProductFusion;
@ -692,23 +692,18 @@ export default defineComponent({
}
},
isIpAddress(str: string) {
return (
str == "localhost" ||
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
str
)
);
return ValidationUtil.isIpAddress(str);
},
changeMagic(){
if(function_magic_wall.value){
function_fusion.value=false;
changeMagic() {
if (function_magic_wall.value) {
function_fusion.value = false;
}
},
changeFusion(){
if(function_fusion.value){
function_magic_wall.value=false;
}
changeFusion() {
if (function_fusion.value) {
function_magic_wall.value = false;
}
},
};
},
});