更新 'app.js'
This commit is contained in:
parent
49db00abfd
commit
9156beda01
2
app.js
2
app.js
@ -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, referer");
|
||||
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表示具体请求中的媒体类型信息
|
||||
|
Loading…
Reference in New Issue
Block a user