node的app.js设置下请求头为具体域名,Credentials设为true
app.use(async (ctx, next)=> {
ctx.set('Access-Control-Allow-Credentials', 'true');
ctx.set('Access-Control-Allow-Origin', 'http://localhost:3001');
ctx.set('Access-Control-Allow-Headers', 'Content-Type');
ctx.set('Access-Control-Allow-Methods', 'POST');
await next();
});