请求ajax后执行一个方法
function loadCameraTree() { axios.get(window.predefined.publicPathPrefix + "api/camera").then(function (response) { var cameraTree = response.data; cameraTree = {"name": "摄像头列表", open: true, "id": -1, "type": "Dir", "children": cameraTree}; initCameraTree(cameraTree); selNode = $.fn.zTree.getZTreeObj("cameraTree").getNodes()[0]; renderTable(selNode); }).catch(function (error) { console.error(error) bootstrapAlert("读取摄像头失败,请刷新并重试"); }) }post传参
axios.post('/api/flight/video', { base64Img: obj['base64'] }).then(function (response) { }).catch(function (error) { console.log(error); });各种请求传参 get delete 方法较为不同
axios.get(url[, config]) axios.delete(url[, config]) axios.post(url[, data[, config]]) axios.put(url[, data[, config]]) axios.patch(url[, data[, config]])