Vercel静态网站CORS跨域解决
河城凌风(kawashiro-ryofu) Lv5

编辑项目根目录vercel.json

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"headers": [
{
"source": "/",
"headers": [
{ "key": "Access-Control-Allow-Credentials", "value": "true" },
{ "key": "Access-Control-Allow-Origin", "value": "https://www.kawashiros.club" },
{ "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }
]
}
]
}

修改Access-Control-Allow-Origin为允许的域名。

 评论
评论插件加载失败
正在加载评论插件