飞书报跨域

29 阅读1分钟

原因:前端请求带了 withCredentials: true,但后端的跨域配置了 Access-Control-Allow-Origin: *,这是浏览器明确禁止的。

一旦 withCredentials = true,浏览器就要求:

  1. Access-Control-Allow-Origin 不能是 *

  2. ✅ 必须是明确的源,例如:

    http://localhost:3001