hyzp_ybqx-Commit038:已经解决LED数据为空时,报错终止的问题
This commit is contained in:
@@ -218,9 +218,23 @@ Future getLedXsxxGetData({@required int id, @required String theSbgllx}) async {
|
||||
print('map = ${map}');
|
||||
Response response = await dio.post(mapHyshlx[theSbgllx]['apiItem'], data: map);
|
||||
printWrapped('response = ${response.toString()}');
|
||||
// [log] response = {"ret":200,"data":false,"msg":""}
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
Map _mapGetSbglGetDataRet = await getMapFromJson(response.data);
|
||||
// 避免 response = {"ret":200,"data":false,"msg":""} 时,报错终止
|
||||
if (false == _mapGetSbglGetDataRet['data']) {
|
||||
_mapGetSbglGetDataRet['data'] = {
|
||||
"id": 1,
|
||||
"dwip": "",
|
||||
"xsnr": "",
|
||||
"xsts": 0, //显示抓拍到的多少条违章记录
|
||||
"stime": "",
|
||||
"etime": "",
|
||||
"addtime": "",
|
||||
"updatetime": ""
|
||||
};
|
||||
}
|
||||
_mapGetSbglGetData = _mapGetSbglGetDataRet['data'];
|
||||
|
||||
printWrapped('_mapGetSbglGetData[\'xsts\'] = ${_mapGetSbglGetData['xsts']}');
|
||||
|
||||
Reference in New Issue
Block a user