每次Ajax请求完成加载时,我都会收到一条JavaScript控制台日志消息.这个问题在附带的截图中得到了证明.

我不知道我是如何激活此日志记录的.如何停用它?我在使用ExtJS 4.1.
我对微软登录进行HTTP POST请求以获取与邮件API一起使用的访问令牌,请求成功但代码转到我的代码的错误子句.
requestAccessToken(code: string)
{
console.log("request access token");
if (code) {
var headers = new Headers();
headers.append("Content-Type", 'application/x-www-form-urlencoded');
headers.append('Accept', 'application/json');
var requestoptions = new RequestOptions({
headers: headers
});
var body = `grant_type=authorization_code&
redirect_uri=http://localhost:4200&
code=`+ code + `&
client_id=4e[................]5ab&
client_secret=CE[..............]BC`;
this.http.post("https://login.microsoftonline.com/common/oauth2/v2.0/token", body, requestoptions).map((res: Response) =>
{
console.log("response given");
const data = res.json();
}).subscribe( (data) => {
console.log("The data is = " + data);
}, error => {
console.log("The error is = " + error)
});
}
Run Code Online (Sandbox Code Playgroud)
浏览器控制台显示:XMLHttpRequest无法加载https://login.microsoftonline.com/common/oauth2/v2.0/token.请求的资源上不存在"Access-Control-Allow-Origin"标头.因此不允许来源' http:// localhost:4200 …