const checkIp = (rule, value, callback) => {
let checkIp4 = /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/;
let valdata = value.split(/[,;\s]+/g);
let isCorrect = true;
if (valdata.length) {
for (let i = 0; i < valdata.length; i++) {
if (checkIp4.test(valdata[i]) == false) {
isCorrect = false;
}
}
}
if (value == null || value == "" || value == "undefined") {
return callback();
} else if (!isCorrect) {
callback(new Error("请输入正确的ip地址"));
} else {
callback();
}
};