wangchuanjin 2 년 전
부모
커밋
f83526a72f
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  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 := ""