嗨,我有一个 nuxt + strapi 项目,我正在使用 Snipcart 进行付款。
当前的strapi调用:
async asyncData({ $strapi, route, i18n }) {
const response = await $strapi.find('products', {
_locale: i18n.locale,
slug: route.params.slug,
})
const product = response[0]
return { product }
},
这是我目前正在使用的按钮:
<button
v-if="product.suscription === true"
class="
snipcart-add-item
mt-4
bg-white
border border-gray-200
d
hover:shadow-lg
text-gray-700
font-semibold
py-2
px-4
rounded
shadow
"
:data-item-id="product.id"
:data-item-price="product.price"
:data-item-url="`${storeUrl}${this.$route.path}`"
data-item-payment-interval="Month"
data-item-payment-interval-count="2"
data-item-payment-trial="10"
:data-item-description="product.description"
:data-item-image="product.image.formats.small.url"
:data-item-name="product.name"
v-bind="customFields"
>
{{ $t('cart.suscription') }}
</button>
这是按添加到购物车后的错误消息:
VM1788 snipcart.js:1 A 'system' error occured in Snipcart.Received invalid payload from server
{data: undefined, kind: 'system', code: 'snipcart_error_operation_failed', message: 'snipcart_error_operation_failed', technicalReason: 'Received invalid payload from server'}
code: "snipcart_error_operation_failed"
data: undefined
kind: "system"
message: "snipcart_error_operation_failed"
technicalReason: "Received invalid payload from server"
这最终会在结帐后出现“产品抓取失败”错误。我不明白是什么让 Snipcart 从 Strapi 获取所有信息。