wangchuanjin 2 éve
szülő
commit
f83526a72f
1 módosított fájl, 9 hozzáadás és 1 törlés
  1. 9 1
      compatible/compatible.go

+ 9 - 1
compatible/compatible.go

@@ -1,6 +1,7 @@
 package compatible
 
 import (
+	"encoding/json"
 	"log"
 	"strings"
 
@@ -182,7 +183,14 @@ func (c *Compatible) updateDo(id string, identity *pb.Identity, update map[strin
 		for k, v := range update {
 			vm, ok := v.(map[string]interface{})
 			if !ok {
-				return false
+				b, err := json.Marshal(v)
+				if err != nil {
+					return false
+				} else if err = json.Unmarshal(b, &vm); err != nil {
+					return false
+				} else if vm == nil || len(vm) == 0 {
+					return false
+				}
 			}
 			up11, up22 := map[string]interface{}{}, map[string]interface{}{}
 			key := ""