spartacus-storefront - 如何配置 Hybris smartedit 以在静态网络服务器中使用 spartacus
问题描述
在将 Hybris smartedit 配置为在静态 Web 服务器(在我的情况下为 Azure 存储帐户)中使用已编译的 Spartacus 时,smartedit 获取对 /cx-preview?cmsTicketId=... 的 URL 引用。这会导致 HTTP 404,因为没有这样的文件可用.
我通过运行编译了斯巴达克斯
构建
目前,我的解决方法是运行一个专用的虚拟机
服务
并安装了所有需要的依赖项。但这仅适用于开发用途。
我已按照https://sap.github.io/cloud-commerce-spartacus-storefront-docs/smartEdit-setup-instructions-for-spartacus/#page-title中的说明进行操作,最后一步作为 Azure 存储帐户只能保存静态内容。
Spartacus UI 在 Azure 存储帐户中运行良好
解决方案
看起来您的 Site 表尚未更新以反映店面的位置:“/cx-preview”清楚地显示了默认 URL,该 URL 来自于 SAP Hybris 商务平台中 smartedit 和 stortefront 位于同一来源时。因此,请确保更新给定站点的 Site 表的 previewUrl 字段。
在这里: https ://sap.github.io/cloud-commerce-spartacus-storefront-docs/smartEdit-setup-instructions-for-spartacus/#configuring-smartedit-to-work-with-a-spartacus-storefront 你会发现,除其他外:
. 确保正确设置 WCMS Cockpit 预览 URL。. 在 Backoffice 中,在 WCMS > 网站 > 您的站点中,单击 WCMS 属性选项卡。. 将 WCMS Cockpit 预览 URL 设置为您的 Spartacus 网站。对于此示例,它 . 应该指向https://localhost:4200
希望这可以帮助。
推荐阅读
- json - 帖子列表
在 http 颤振中 - jekyll - 如何在 jekyll 中对多个集合进行分页?
- java - 突然“无法找到请求目标的有效认证路径”
- postgresql - postgresSQL 如何使用遍历一系列值的条件执行 SELECT 子句?
- ios - 启动框架/Info.plist 时出现所有框架错误:没有这样的文件或目录
- javascript - module.exports 上的 eslint 关键字错误
- python - 如何将市场深度数据流存储到列表/数据框 - TWS(Ibapi Python)
- c# - 如何附加一个新的 id 来记录
- php - 检查null并执行一行或另一行
- javascript - 有没有更好的方法来编写这个抛出“Uncaught RangeError:Maximum call stack size exceeded”的递归函数?