更新 'app.js'
This commit is contained in:
parent
5fa9fd13f2
commit
d0868e6043
1
app.js
1
app.js
@ -42,6 +42,7 @@ app.use(async (ctx, next) => {
|
||||
// 需要获取其他字段时,使用Access-Control-Expose-Headers,
|
||||
// getResponseHeader('myData')可以返回我们所需的值
|
||||
//https://www.rails365.net/articles/cors-jin-jie-expose-headers-wu
|
||||
console.log(ctx.request.body)
|
||||
ctx.set("Access-Control-Expose-Headers", "myData");
|
||||
if(ctx.method == "OPTIONS"){
|
||||
ctx.body = ""
|
||||
|
Loading…
Reference in New Issue
Block a user