You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.在项目中引用SDK,报Access to XMLHttpRequest at 'https://vodreport.qcloud.com/ugcupload_new' from origin 'http://xxx.xxx.cn' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute
的跨域问题;
1.在项目中引用SDK,报Access to XMLHttpRequest at 'https://vodreport.qcloud.com/ugcupload_new' from origin 'http://xxx.xxx.cn' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute
的跨域问题;
2.项目本身设置了axios.defaults.withCredentials = true
3.在vod_reporter.js的172增加axios_1.defaults.withCredentials = false,之后再进行打包,不再报跨域问题
VodReporter.prototype.send = function (reportData) {
if (util_1.default.isDev || util_1.default.isTest) {
console.log("send reportData", reportData);
return;
}
axios_1.defaults.withCredentials = false; //172行增加了这个
axios_1.default.post(this.reportUrl, reportData);
};
提问:针对这种情况,怎么处理合适呢?
The text was updated successfully, but these errors were encountered: