服务器返回为空数据时的处理

    {

       “data”:null,

       “status”:"success",   // 成功为success, 失败为error

       “msg”:"操作成功"

    }


data返回为空时,如果用到了里面的属性,需要进行判断,不然会报错

if(rs.data!=null){

      //对成功值做处理的代码块

}

猜你喜欢

转载自blog.csdn.net/qq_42062941/article/details/80776832