1
pdog18 2018-03-27 22:39:54 +08:00
首先它要是一个正常的 Json 字符串
|
3
MinQ 2018-03-27 23:21:46 +08:00 via Android
不正常的情况下只能把字符串编辑成正常的才能送 Gson 吧
|
4
prolic 2018-03-27 23:56:27 +08:00
最外层 struct Json string,对 Json 再进行一次解析
|
5
xmh51 2018-03-27 23:59:13 +08:00
这个应该就是一个很标准的 json 字符串啊
我猜测 String aaa=xx.get("json) Object=Gson.xxx(aaa) 能说下这个是怎么的不正常法? { "flw": { "base": { "brd": "9", "brdNm": "沃", "calLvl": "4", "calLvlNm": "港澳台通话", "credit": "0", "cty": "510", "netTyp": "02", "netTypNm": "3G", "opnDtTm": "20160905174939", "payTyp": "1", "payTypNm": "预付费", "prdId": "16164699", "prdNm": "(OCS)微信沃派畅视卡", "prv": "051", "rmSts": "3", "rmStsNm": "国内漫游", "simCrd": "8986011692510125080", "sts": "0", "tel": "123456789", "usrSts": "开通", "vpnNm": "OCS 业务" }, "i2g": null, "i3g": { "bgnDt": "20180301", "endDt": "20180327", "inf": [{ "bil": "6630.56", "extLev": "0.00", "extOvr": "1", "extOvrNm": "已使用完", "extUse": "0.00", "pkgLev": "0.00", "pkgOvr": "1", "pkgUse": "1024.00", "ttl": "300091.45" }], "sts": "0" }, "i4g": { "inf": [], "sts": "0" }, "pkg": { "bgnDt": "20180301", "endDt": "20180326", "inf": [{ "lev": "4981.77", "ttl": "11304.00", "typ": "01", "typNm": "上网流量", "use": "6322.23" }, { "lev": "259.00", "ttl": "260.00", "typ": "02", "typNm": "语音电话", "use": "1.00" }], "sts": "0" }, "rc": null }, "msg": { "errMsg": [], "promptMsg": [{ "msgID": "MOL03501I", "msgTxt": "流量查询成功。" }], "warnMsg": [] } } |
6
lianyue 2018-03-28 00:00:34 +08:00
JSON.parse(({"json":"{\"flw\":{\"base\":{\"brd\":\"9\",\"brdNm\":\"沃\",\"calLvl\":\"4\",\"calLvlNm\":\"港澳台通话\",\"credit\":\"0\",\"cty\":\"510\",\"netTyp\":\"02\",\"netTypNm\":\"3G\",\"opnDtTm\":\"20160905174939\",\"payTyp\":\"1\",\"payTypNm\":\"预付费\",\"prdId\":\"16164699\",\"prdNm\":\"(OCS)微信沃派畅视卡\",\"prv\":\"051\",\"rmSts\":\"3\",\"rmStsNm\":\"国内漫游\",\"simCrd\":\"8986011692510125080\",\"sts\":\"0\",\"tel\":\"123456789\",\"usrSts\":\"开通\",\"vpnNm\":\"OCS 业务\"},\"i2g\":null,\"i3g\":{\"bgnDt\":\"20180301\",\"endDt\":\"20180327\",\"inf\":[{\"bil\":\"6630.56\",\"extLev\":\"0.00\",\"extOvr\":\"1\",\"extOvrNm\":\"已使用完\",\"extUse\":\"0.00\",\"pkgLev\":\"0.00\",\"pkgOvr\":\"1\",\"pkgUse\":\"1024.00\",\"ttl\":\"300091.45\"}],\"sts\":\"0\"},\"i4g\":{\"inf\":[],\"sts\":\"0\"},\"pkg\":{\"bgnDt\":\"20180301\",\"endDt\":\"20180326\",\"inf\":[{\"lev\":\"4981.77\",\"ttl\":\"11304.00\",\"typ\":\"01\",\"typNm\":\"上网流量\",\"use\":\"6322.23\"},{\"lev\":\"259.00\",\"ttl\":\"260.00\",\"typ\":\"02\",\"typNm\":\"语音电话\",\"use\":\"1.00\"}],\"sts\":\"0\"},\"rc\":null},\"msg\":{\"errMsg\":[],\"promptMsg\":[{\"msgID\":\"MOL03501I\",\"msgTxt\":\"流量查询成功。\"}],\"warnMsg\":[]}}"}).json)
这是很正常的 json 吧 json 嵌套了下 json |
7
cs923 2018-03-28 01:24:43 +08:00 via Android
多了很多转义符号 格式化一下就很清楚了
|
8
vincenttone 2018-03-28 14:54:23 +08:00
先解一次 json,然后拿字典中 json 对应的字符串再解一次,over
|