|
10精币
大佬们,请求返回的时候,返回过来多个json应该如何一一对应,一次处理这些JSON参数
例如 我现在拿到单个JSON是 {"app":"123123","user":241001004,"tar":"1888855","goods_id":10000108,"goods_name":"888","outer_goods_code":"","datas":{"operator_id":"888","prov_code":"888","amount":"1"},"vender_id":10,"timestamp":1727793069,"official_payment":"0000000","user_quote_type":1,"user_quote_payment":"000","user_payment":"000","sign":"1407fbefdbf2eb553324bba2a9e8fe01"}
这个是返回了一条的时候可以正常处理,但是有的时候会返回 2条 3条或者更多 例如
{"app":"123123","user":241001004,"tar":"1888855","goods_id":10000108,"goods_name":"888","outer_goods_code":"","datas":{"operator_id":"888","prov_code":"888","amount":"1"},"vender_id":10,"timestamp":1727793069,"official_payment":"0000000","user_quote_type":1,"user_quote_payment":"000","user_payment":"000","sign":"1407fbefdbf2eb553324bba2a9e8fe01"}
{"app":"123123","user":241001004,"tar":"1888855","goods_id":10000108,"goods_name":"888","outer_goods_code":"","datas":{"operator_id":"888","prov_code":"888","amount":"1"},"vender_id":10,"timestamp":1727793069,"official_payment":"0000000","user_quote_type":1,"user_quote_payment":"000","user_payment":"000","sign":"1407fbefdbf2eb553324bba2a9e8fe01"}
这样子一下返回来了两条json,这样的话只能解析第一个,第二个就没办法处理了
这种情况应该怎么解析,然后依次进行下一步的操作
|
最佳答案
查看完整内容
.版本 2
.子程序 _按钮1_被单击
.局部变量 返回, 文本型
.局部变量 分割json, 文本型
.局部变量 n, 整数型
.局部变量 json, 类_json
返回 = “”
分割json = 分割文本 (返回, #换行符, )
.计次循环首 (取数组成员数 (分割json), n)
json.解析 (分割json [n])
.计次循环尾 ()
|