使用koa2-cors使用这个模块配置跨域,和跨域获取cookie const cors = require("koa2-cors")app.use(cors({ origin:ctx=>{ return ctx.headers.origin }, credentials:true}))