增加shift+鼠标左键定位代码功能,增加自动创建资源权限标识功能,细节调优。 (#1225)
* fix: 增加索引解决登录太慢的问题 * 增加shift+鼠标左键自动定位到编辑工具代码行的功能 * 过滤功能性标签 防止意外错误 * [utils\validator.go]:修复了当判断字符长度时,当字符串长度为中文,会判断错误。 * 增加资源标识 Co-authored-by: hexiang3000 <91460121+hexiang3000@users.noreply.github.com> Co-authored-by: fanyibo <29974992@qq.com>
This commit is contained in:
@@ -38,11 +38,11 @@ func NotEmpty() string {
|
||||
return "notEmpty"
|
||||
}
|
||||
|
||||
//@author: [zooqkl](https://github.com/zooqkl)
|
||||
//@function: RegexpMatch
|
||||
//@description: 正则校验 校验输入项是否满足正则表达式
|
||||
//@param: rule string
|
||||
//@return: string
|
||||
// @author: [zooqkl](https://github.com/zooqkl)
|
||||
// @function: RegexpMatch
|
||||
// @description: 正则校验 校验输入项是否满足正则表达式
|
||||
// @param: rule string
|
||||
// @return: string
|
||||
func RegexpMatch(rule string) string {
|
||||
return "regexp=" + rule
|
||||
}
|
||||
@@ -166,7 +166,9 @@ func Verify(st interface{}, roleMap Rules) (err error) {
|
||||
|
||||
func compareVerify(value reflect.Value, VerifyStr string) bool {
|
||||
switch value.Kind() {
|
||||
case reflect.String, reflect.Slice, reflect.Array:
|
||||
case reflect.String:
|
||||
return compare(len([]rune(value.String())), VerifyStr)
|
||||
case reflect.Slice, reflect.Array:
|
||||
return compare(value.Len(), VerifyStr)
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
return compare(value.Uint(), VerifyStr)
|
||||
@@ -187,7 +189,7 @@ func compareVerify(value reflect.Value, VerifyStr string) bool {
|
||||
|
||||
func isBlank(value reflect.Value) bool {
|
||||
switch value.Kind() {
|
||||
case reflect.String:
|
||||
case reflect.String, reflect.Slice:
|
||||
return value.Len() == 0
|
||||
case reflect.Bool:
|
||||
return !value.Bool()
|
||||
|
Reference in New Issue
Block a user