在NestJS中允许接口跨域
//main.ts
app.enableCors({
origin: '*',
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
preflightContinue: true,
optionsSuccessStatus: 204,
credentials: true,
allowedHeaders: [
'Origin',
'X-Requested-With',
'Content-Type',
'Accept',
'Content-Type',
'Authorization',
],
});
在NestJS中允许接口跨域
https://blog.jiang.in/archives/86d2679f-3d3f-4439-ba63-a6c5fff0deb1