Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ip validator on (producer/consumer) input component #152

Merged
merged 3 commits into from
Mar 12, 2020
Merged

add ip validator on (producer/consumer) input component #152

merged 3 commits into from
Mar 12, 2020

Conversation

iamazy
Copy link
Contributor

@iamazy iamazy commented Mar 11, 2020

No description provided.

@@ -151,6 +151,24 @@ export default {
callback()
}
}
let validateIp = (rule, value ,callback) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以直接用正则匹配IP列表,不需要用JS先split再一个一个匹配。

参考:

^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))(,(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])).(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5])))*$

@liyue2008 liyue2008 merged commit 0b7e023 into jd-opensource:master Mar 12, 2020
@iamazy iamazy deleted the master-ip-format-check branch June 11, 2020 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants