From 2d15254199ad649ac8e47fe46ed314984f94070f Mon Sep 17 00:00:00 2001 From: "wkylin.w" Date: Sat, 22 Jul 2023 17:14:30 +0800 Subject: [PATCH] feat: find ip --- src/components/stateful/markmap/index.jsx | 2 +- src/components/stateless/UserIP/index.jsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/stateful/markmap/index.jsx b/src/components/stateful/markmap/index.jsx index 3c1e2635..30b647e9 100644 --- a/src/components/stateful/markmap/index.jsx +++ b/src/components/stateful/markmap/index.jsx @@ -44,7 +44,7 @@ const MarkmapHooks = ({ markmap }) => { }, []) useEffect(() => { - const mm = refMm.current + const mm = refMm.currentdsds // if (!mm) return // const { root } = transformer.transform(markmap) const { root } = transformer.transform(initValue) diff --git a/src/components/stateless/UserIP/index.jsx b/src/components/stateless/UserIP/index.jsx index 3cf78e48..3a0f3a25 100644 --- a/src/components/stateless/UserIP/index.jsx +++ b/src/components/stateless/UserIP/index.jsx @@ -13,10 +13,10 @@ const UserIP = () => { .then((response) => response.json()) .then((data) => { const ipAddress = data.ip - setUserIp(ipAddress) + setUserIp(ipAddress ?? '0.0.0.0') }) - .catch((error) => { - console.error('Error:', error) + .catch(() => { + setUserIp('0.0.0.0') }) }