我想使用“ ip”验证,但尝试了类似的方法
attributes: {
type: 'string',
ip: true
}
但是当我提供192.168.2.1或其他任何IP时,它总是拒绝。
我知道此页面中有可用列表http://sailsjs.org/#!documentation/models
但是,他们没有解释如何使用每一个。如果有人知道其他好的文件或任何使用规则,请!
首先,您需要给属性命名。然后,要使用IP验证程序,请将type
属性的设置为ip
:
attributes: {
ipAddr: {
type: 'ip'
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句