首页 > 解决方案 > 如何配置 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 存储帐户中运行良好

标签: spartacus-storefront

解决方案


看起来您的 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

希望这可以帮助。


推荐阅读