when using webpack + iview + axios, to get nail token, the following phenomenon occurs. The relevant JSON, has been obtained in the response, but ajax indicates that ERROR, does not know what the problem is, so solve it.
the AJAX code is as follows:
query: function () {
let url = "https://oapi.dingtalk.com/gettoken";
let CorpID = "xxxx";
let CorpSecret = "xxxx";
let accessTokenRequest = {
url: url,
method: "get",
params: {
corpid: CorpID,
corpsecret: CorpSecret
},
};
axios(accessTokenRequest).then(response => {
console.info(response);
}).catch(error => {
console.info(error);
});
},