ice-lab / icestark

:tiger: Micro Frontends solution for large application(面向大型应用的微前端解决方案),站点国内镜像:https://icestark.gitee.io
https://micro-frontends.ice.work
MIT License
2.03k stars 173 forks source link

[QUESTION]如何请求mode改为no-cors #685

Open xmsz opened 1 year ago

xmsz commented 1 year ago

Do you want to request a feature or report a bug? feature

What is the current behavior? 正常会出现

image

然后如果是这样可以成功

fetch("https://htsy.cpshelp.cn/client-modules/setting/runtime.json?v=1684313213887", {
  "headers": {
    "accept": "*/*",
    "accept-language": "zh-CN",
    "sec-ch-ua": "\"Not A(Brand\";v=\"24\", \"Chromium\";v=\"110\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "cross-site"
  },
  "referrer": "http://localhost:1212/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": null,
  "method": "GET",
  "mode": "no-cors",
  "credentials": "omit"
});

需求

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

ClarkXia commented 1 year ago

自定义下 fetch https://micro-frontends.ice.work/docs/api/ice-stark/#fetch