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
控制台报错信息: Error: Network Error at createError (eval at <anonymous> (app.js:1834), <anonymous>:15:15) at XMLHttpRequest.handleError (eval at <anonymous> (app.js:1813), <anonymous>:87:14)
The text was updated successfully, but these errors were encountered:
我将代码中的config.withCredentials = true打开了。
axios.interceptors.request.use(config => { // Do something before request is sent config.withCredentials = true // 需要跨域打开此配置 // post提交 data存在 并且 data不是FormData对象时对数据进行json化处理 // if(config.method==='post' && config.data && config.data.constructor !== FormData){ // config.data = qs.stringify(config.data) // config.headers['Content-Type'] = 'application/x-www-form-urlencoded' // } // 开启loading动画 store.dispatch('popup/loading/showLoading') return config }, function(error) { // Do something with request error return Promise.reject(error) })
后台设置了rst.headers['Access-Control-Allow-Origin'] = '*'
控制台报错信息:
Error: Network Error at createError (eval at <anonymous> (app.js:1834), <anonymous>:15:15) at XMLHttpRequest.handleError (eval at <anonymous> (app.js:1813), <anonymous>:87:14)
The text was updated successfully, but these errors were encountered: