vue出现 The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard
问题vue中使用axios+整合后端php请求接口出现AccesstoXMLHttpRequestat'http://localhost:82/clien/aboutUs'fromorigin'http://localhost'hasbeenblockedbyCORSpolicy:Thevalueofthe'Access-Control-Allow-Orig...
·
问题
vue中使用axios+整合后端php请求接口出现Access to XMLHttpRequest at 'http://localhost:82/clien/aboutUs' from origin 'http://localhost' has been blocked by CORS policy: 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.
解决:
以下配置改为false
axios.defaults.withCredentials = true;
更多推荐
已为社区贡献1条内容
所有评论(0)