From 5dc49628ee0892f127499b47ad5a5fb7c24d1b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E5=93=A5?= <2412953429@qq.com> Date: Sun, 16 Jun 2024 19:01:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=9C=80=E7=BB=88=E7=89=881.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Front/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/Front/index.tsx b/src/pages/Front/index.tsx index fd7829a..8576c7a 100644 --- a/src/pages/Front/index.tsx +++ b/src/pages/Front/index.tsx @@ -76,17 +76,18 @@ const index: FC = () => { const socket = io('http://localhost:4000') setSocket(socket) + // 默认socket.io-client包含一个心跳机制,定期检查连接状态,所以不需要手动定时器进行心跳的设置,避免重复发送心跳 // 设置心跳机制 - const heartbeat = setInterval(() => { - if (socket) { - socket.emit('heartbeat') - } - }, 60000) + // const heartbeat = setInterval(() => { + // if (socket) { + // socket.emit('heartbeat') + // } + // }, 120000) return () => { if (socket) { socket.disconnect() } - clearInterval(heartbeat) + // clearInterval(heartbeat) } }, []) useEffect(() => { -- Gitee From c86f0bb15b730e1e787b98a42499779fd00d280d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E5=93=A5?= <2412953429@qq.com> Date: Sun, 16 Jun 2024 19:20:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=9C=80=E7=BB=88=E7=89=881.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Front/index.tsx | 1 - src/pages/commodity/commodityList/index.tsx | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/pages/Front/index.tsx b/src/pages/Front/index.tsx index 8576c7a..c876fad 100644 --- a/src/pages/Front/index.tsx +++ b/src/pages/Front/index.tsx @@ -141,7 +141,6 @@ const index: FC = () => { const label: string = findLabel(newMenus, event.key) addTabs(label, event.key) dispatch(setActiveKey(`/${event.key}`)) - console.log(event.key) dispatch(setSelectedKeys([event.key])) dispatch(activeTabs(event.key)) diff --git a/src/pages/commodity/commodityList/index.tsx b/src/pages/commodity/commodityList/index.tsx index 100c4de..4038d99 100644 --- a/src/pages/commodity/commodityList/index.tsx +++ b/src/pages/commodity/commodityList/index.tsx @@ -121,7 +121,6 @@ export default function CommodityList() { key: item.id })) setCommodityList(dataSource) - console.log(data) } }, [data]) @@ -160,14 +159,12 @@ export default function CommodityList() { // 获取选中的类型数据 const onChangeClassify = (value: number[]) => { - console.log('获取商品分类选中的数据===', value) setCurrentValue(value) setProductCategoryId(value.length > 0 ? value[value.length - 1] : 0) } // 获取选中的品牌数据 const onChangeBrand = (value: number[]) => { - console.log('获取商品品牌选中的数据===', value) setBrandId(value.length > 0 ? value[0] : 0) setCurrentBrand(value) } @@ -235,7 +232,6 @@ export default function CommodityList() { // 多条件搜索 const searchResult = () => { - console.log('触发搜素方法') setSearchBrandId(brandId) setSearchProductCategoryId(productCategoryId) setSearchProductName(productName) -- Gitee