function logina (id, password) {
let url = "url";
let json = {
loginid: id,
password: password
};
let result = Post (url, json, null);
console.log (1, result);
return result;
}
function Post (api, post, headers) {
let result = false;
axios.post (api, post, {headers: headers})
.then((function(response) {
console.log("post", response);
return response;
}))
.catch(function(err) {
console.log(err);
return result;
});
}
Thecode is shown above, and if successful, the result executed by console is undefined. After that, the corresponding data of post will be returned. How to make result return the data of response