From c8b44f36209b0d62a1f4c536319f6c924e08340d Mon Sep 17 00:00:00 2001 From: dzq Date: Tue, 1 Jul 2025 08:27:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E6=97=B6=E7=BC=BA=E5=B0=91?= =?UTF-8?q?corpid=E5=8F=82=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在获取统计数据时添加corpid参数,确保接口请求正确过滤对应企业的数据 --- src/api/shop/stats.ts | 8 ++++++-- src/views/welcome/index.vue | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/shop/stats.ts b/src/api/shop/stats.ts index b1ba8d6..adc2d83 100644 --- a/src/api/shop/stats.ts +++ b/src/api/shop/stats.ts @@ -78,6 +78,10 @@ export interface StatsDTO { * 获取统计数据 * @returns 包含统计数据的响应 */ -export const getStats = () => { - return http.request>('get', '/shop/shops/Stats'); +export const getStats = (corpid: string) => { + return http.request>('get', '/shop/shops/Stats', { + params: { + corpid, + }, + }); }; \ No newline at end of file diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index 3752de2..08c0459 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -64,7 +64,7 @@ const handleSubmit = async () => { onMounted(async () => { try { - const { data } = await getStats(); + const { data } = await getStats(wxStore.corpid); shopData.value = [ { name: '商店', icon: markRaw(Shop), value: data.shopCount }, { name: '商品总数量', icon: markRaw(Goods), value: data.goodsCount },