更新 'app.js'

This commit is contained in:
luyuan 2021-02-22 15:01:55 +08:00
parent 2ef9823b2f
commit 49db00abfd

2
app.js
View File

@ -13,7 +13,7 @@ app.use(async (ctx, next) => {
ctx.set("Access-Control-Allow-Methods", "OPTIONS, GET, PUT, POST, DELETE");
// 字段是必需的。它也是一个逗号分隔的字符串,表明服务器支持的所有头信息字段.
ctx.set("Access-Control-Allow-Headers", "x-requested-with, accept, origin, content-type");
ctx.set("Access-Control-Allow-Headers", "x-requested-with, accept, origin, content-type, referer");
// 服务器收到请求以后检查了Origin、Access-Control-Request-Method和Access-Control-Request-Headers字段以后确认允许跨源请求就可以做出回应。
// Content-Type表示具体请求中的媒体类型信息