发布数据时,出现两个错误。 我该如何解决错误。(这是laravel的api)
我在axios config的标题中添加了一些代码。 就像... X-Requested-With
axios.interceptors.request.use(config => {
setAccessToken(config);
config.headers['X-XSRF-TOKEN'] = getCookieValue('XSRF-TOKEN')
config.headers['X-Requested-With'] = 'XMLHttpRequest'
config.headers['Content-Type'] = 'application/json'
config.headers['withCredentials'] = true
return config
})
这些是错误。
Mixed Content: The page at 'https://xxx/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xxx/'. This request has been blocked; the content must be served over HTTPS.
app.js?id=.... err auth login = Error: Network Error
at LYNF.e.exports (app.js?id=....)
at XMLHttpRequest.u.onerror (app.js?id=....)