首页
技术
登录
6mi
u
盘
搜
搜 索
技术
Node 跨域 Access to XMLHttpRequest at ‘url‘ from origin ‘null‘ has been blocked by CORS policy: Req...
Node 跨域 Access to XMLHttpRequest at ‘url‘ from origin ‘null‘ has been blocked by CORS policy: Req...
技术
2022-07-10
99
如果跨域用到了put,patch方法,要在响应头设置
// koa app.use(async (ctx, next) => { ctx.set('Access-Control-Allow-Origin','*') ctx.set("Access-Control-Allow-Methods", "POST, GET, DELETE,PATCH,PUT"); ctx.response.status = 200 ; await next(); });
转载请注明原文地址:https://ipadbbs.8miu.com/read-1400.html
最新回复
(
0
)