编辑json字段并更新现有文件

时间:2019-06-18 18:46:59

标签: json go

我有一个创世纪的json文件,我需要从文件路径中读取它,并需要更新字段值“ alloc”值并保存到现有文件中,需要一些建议

    var vehiculeHorsZone = false;
    var promise = new Promise((resolve, reject) => {
        $.ajax({url:"/flotte/getVehicules",
                type:"post",
                success:function(data, status, xhr) {
                            resolve(data);
                        },
                error:function(xhr, status, error) {
                         reject(error);
           }});
    });
    promise.then((data) => {
                             ...
                             vehiculeHorsZone = google.maps.geometry.poly.containsLocation(someLatLng, somePolygone);
                             console.log("---- from promise , vehiculeHorsZone = ",vehiculeHorsZone);
                           });
    console.log("---- after promise , vehiculeHorsZone = ",vehiculeHorsZone);

0 个答案:

没有答案