Browse Source

增加校验规则

yufei
余菲 9 months ago
parent
commit
abfcf64bc3
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      utils/check.js

+ 7
- 0
utils/check.js View File

export const isPositiveInteger = function(value) { export const isPositiveInteger = function(value) {
var re = /^[0-9]+$/ ; var re = /^[0-9]+$/ ;
return re.test(value) return re.test(value)
}
/**
* 校验数字、字母或汉字
*/
export const isNoCharacters = function(value) {
var re = /^[\u4e00-\u9fa5_a-zA-z0-9]+$/ ;
return re.test(value)
} }

Loading…
Cancel
Save