|
@@ -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 = "/") => {
|