路由规则找不到的时候提示用户

This commit is contained in:
刘祥超
2023-07-17 15:30:19 +08:00
parent 2d4378423b
commit a99bcdc437
6 changed files with 36 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
package utils
import (
"bytes"
"encoding/json"
"reflect"
)
@@ -22,3 +23,8 @@ func JSONClone(v interface{}) (interface{}, error) {
return nv, nil
}
// 判断JSON数据是否为null
func JSONIsNull(jsonData []byte) bool {
return len(jsonData) == 0 || bytes.Equal(jsonData, []byte("null"))
}