fix: 商品管理使用getAllProducts接口显示所有商品(包括下架)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-04-01 15:18:48 +00:00
parent 08f440f7c8
commit 5dc15bb2a9
2 changed files with 9 additions and 2 deletions

View File

@@ -33,12 +33,19 @@ export default {
}, },
/** /**
* 获取商品列表 * 获取商品列表(只显示上架)
*/ */
getProducts(params) { getProducts(params) {
return api.request('/products', 'GET', params) return api.request('/products', 'GET', params)
}, },
/**
* 获取所有商品(包括下架,用于管理)
*/
getAllProducts(params) {
return api.request('/products/all', 'GET', params)
},
/** /**
* 获取商品详情 * 获取商品详情
*/ */

View File

@@ -194,7 +194,7 @@ export default {
}, },
async loadProducts() { async loadProducts() {
try { try {
const res = await productApi.getProducts({ const res = await productApi.getAllProducts({
keyword: this.keyword, keyword: this.keyword,
categoryId: this.categoryId, categoryId: this.categoryId,
page: 1, page: 1,