From 5dc15bb2a92d4c89031ab5b12f051c01320b727f Mon Sep 17 00:00:00 2001 From: Agent Date: Wed, 1 Apr 2026 15:18:48 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BD=BF=E7=94=A8getAllProducts=E6=8E=A5=E5=8F=A3=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=89=80=E6=9C=89=E5=95=86=E5=93=81=EF=BC=88=E5=8C=85?= =?UTF-8?q?=E6=8B=AC=E4=B8=8B=E6=9E=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product.js | 9 ++++++++- src/pages/product/manage.vue | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/api/product.js b/src/api/product.js index 01cd26a..e48a328 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -33,12 +33,19 @@ export default { }, /** - * 获取商品列表 + * 获取商品列表(只显示上架) */ getProducts(params) { return api.request('/products', 'GET', params) }, + /** + * 获取所有商品(包括下架,用于管理) + */ + getAllProducts(params) { + return api.request('/products/all', 'GET', params) + }, + /** * 获取商品详情 */ diff --git a/src/pages/product/manage.vue b/src/pages/product/manage.vue index 83b32c1..c3d3716 100644 --- a/src/pages/product/manage.vue +++ b/src/pages/product/manage.vue @@ -194,7 +194,7 @@ export default { }, async loadProducts() { try { - const res = await productApi.getProducts({ + const res = await productApi.getAllProducts({ keyword: this.keyword, categoryId: this.categoryId, page: 1,