浏览代码

fix:断言

zhangxinlei1996 3 年之前
父节点
当前提交
300d5323ee
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      entity/subscribe.go

+ 8 - 1
entity/subscribe.go

@@ -141,7 +141,14 @@ func (this *UserInfoReq) format(data *map[string]interface{}) *map[string]interf
 		a_items := common.ObjArrToMapArr((*data)["a_items"].([]interface{}))
 		a_items := common.ObjArrToMapArr((*data)["a_items"].([]interface{}))
 		for k, v := range a_items {
 		for k, v := range a_items {
 			if v["a_key"] != nil {
 			if v["a_key"] != nil {
-				a_keys := common.ObjArrToMapArr(v["a_key"].([]interface{}))
+				a_keys := []map[string]interface{}{}
+				ak, ok := v["a_key"].([]interface{})
+				if !ok {
+					a_keys, _ = v["a_key"].([]map[string]interface{})
+				} else {
+					a_keys = common.ObjArrToMapArr(ak)
+
+				}
 				for kk, vv := range a_keys {
 				for kk, vv := range a_keys {
 					if vv["key"] != nil {
 					if vv["key"] != nil {
 						keyArr, ok1 := vv["key"].([]interface{})
 						keyArr, ok1 := vv["key"].([]interface{})