diff --git a/src/pages/Front/index.tsx b/src/pages/Front/index.tsx index fd7829a4477c71e1797569e65db5b4dda628dd46..c876fad0b5a51db62c56a0d375396ec1e4e96b1f 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(() => { @@ -140,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 100c4de902525a6937eec34f85fa54aed7c07cf5..4038d99b4256aed9ae4feafad5d387a7317a3a83 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)