This commit is contained in:
luyuan 2021-02-24 09:06:51 +08:00
commit 81585f81f7
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

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, user-agent");
// 服务器收到请求以后检查了Origin、Access-Control-Request-Method和Access-Control-Request-Headers字段以后确认允许跨源请求就可以做出回应。
// Content-Type表示具体请求中的媒体类型信息