【问题标题】:Issues with Smartedit in Development environment开发环境中 Smartedit 的问题
【发布时间】:2022-08-02 18:02:13
【问题描述】:
我使用的是 SAP hybris 2105,但 Smartedit 存在一些问题。 Smartedit 在 localsetup 上运行良好,但它不允许我在开发或生产环境中进行编辑。我注意到下面的 api 没有返回 DEV 环境中的所有必需组件,但在本地它返回所有组件。在 Dev 它只返回 1 个组件。
/cmswebservices/v1/catalogs/fffContentCatalog/versions/Online/pages/homepage/typerestrictions
回复:
[{\"contentSlotUid\":\"MiniCartSlot\",\"validComponentTypes\":[\"MiniCartComponent\",\"NavigationComponent\"]}]
关于如何修复或调试的任何建议,因为这只发生在 DEV 中。
标签:
sap-commerce-cloud
spartacus-storefront
【解决方案1】:
我认为你应该添加智能编辑配置为了列入白名单的网址被允许访问您的 smartedit 站点。
例子:
UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]
$smartediturl=$config-domain.smartedit.url
INSERT_UPDATE SmartEditConfiguration;key[unique=true];value
;whiteListedStorefronts;$smartediturl
然后在config目录下,添加domain.smartedit.url键和它在 .properties 文件中的值。
- local.properties 文件:
domain.smartedit.url= ["*"]
- 本地开发属性:
domain.smartedit.url= ["<your_dev_domain>"]
- local-stg.properties:
domain.smartedit.url= ["<your_stg_domain>"]
- 本地-prd.properties:
domain.smartedit.url= ["<your_prd_domain>"]
问候。