SAP Spartacus需要连接后台Commerce Cloud才能工作:
Access to XMLHttpRequest at ‘
https://spartacus-dev0.eastus.cloudapp.azure.com:9002/occ/v211/electronics-spa/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=homepage&lang=en&curr=USD’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
配置后台Commerce Cloud的详细位置:
C:\Code\SPA\spartacus\projects\storefrontapp\src\environments\environment.ts