前后端均已部署完毕,前端在vue.config.js中添加了
proxy: {
'/api': {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true,
ws: true,
secure:true,
pathRewrite: {
'^/api': ''
}
}
}
登陆的时候控制台还是会提示
ccess to XMLHttpRequest at 'https://xxx/api/admin/getAdminInfoByToken?token=adb9ecc3366746e1a46f91aec3fdb8cd&temp=1723164992' from origin 'http://localhost:9527' has been blocked by CORS policy: Request header field authori-zation is not allowed by Access-Control-Allow-Headers in preflight response.
前端还需要怎么处理?服务器端需要添加什么?求指教?