Pārlūkot izejas kodu

Merge branch 'feature-chaojie' into dev

username 1 gadu atpakaļ
vecāks
revīzija
55b3d90233
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      src/app/[locale]/(ordinary)/profile/page.tsx

+ 3 - 3
src/app/[locale]/(ordinary)/profile/page.tsx

@@ -30,8 +30,8 @@ const Profile: FC<Props> = () => {
         getUserMoneyApi().then((res) => {
             res.code == 200 &&
                 setMoney({
-                    deposit: res.data.deposit,
-                    point: res.data.point,
+                    deposit: res.data?.deposit || 0.0,
+                    point: res.data?.point || 0.0
                 });
         });
     };
@@ -41,7 +41,7 @@ const Profile: FC<Props> = () => {
             userMoneyRequest();
         }
         // eslint-disable-next-line react-hooks/exhaustive-deps
-    }, []);
+    }, [token]);
 
     const router = useRouter();
     const goPage = (path = "/") => {