From b22cdae4fe587ce998590cac1c479ef71ee96fc8 Mon Sep 17 00:00:00 2001 From: D Date: Tue, 13 Aug 2024 21:57:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=87=8F=E4=B8=BA0=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/store/cart.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sheep/store/cart.js b/sheep/store/cart.js index 7ea70199..edde779d 100644 --- a/sheep/store/cart.js +++ b/sheep/store/cart.js @@ -57,7 +57,13 @@ const cart = defineStore({ // 移除购物车 async delete(ids) { - const { code } = await CartApi.deleteCart(ids.join(',')); + let idsTemp = ''; + if (Array.isArray(ids)) { + idsTemp = ids.join(','); + } else { + idsTemp = ids; + } + const { code } = await CartApi.deleteCart(idsTemp); if (code === 0) { await this.getList(); }