购物车商品数量减为0时,删除错误
parent
4db992d3fa
commit
b22cdae4fe
|
@ -57,7 +57,13 @@ const cart = defineStore({
|
||||||
|
|
||||||
// 移除购物车
|
// 移除购物车
|
||||||
async delete(ids) {
|
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) {
|
if (code === 0) {
|
||||||
await this.getList();
|
await this.getList();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue