Prechádzať zdrojové kódy

fix: 修改Week组件类型

Before 7 mesiacov pred
rodič
commit
e8d03b0045

+ 2 - 2
src/app/[locale]/(navbar)/cashback/@cashbackInfo/Week.tsx

@@ -7,7 +7,7 @@ import Extract from "./components/Extract";
 interface Props {
     cashbackInfo: CashbackTypes;
 }
-const Page = async (props: Props) => {
+const Week = async (props: Props) => {
     const { cashbackInfo } = props;
     const local = await getLocale();
     const t = await getTranslations("cashback");
@@ -40,4 +40,4 @@ const Page = async (props: Props) => {
         </Box>
     );
 };
-export default Page;
+export default Week;

+ 13 - 1
src/app/[locale]/(navbar)/cashback/@cashbackInfo/page.tsx

@@ -35,12 +35,24 @@ const getCashBackApi = async () => {
         })
         .then((res) => {
             return res.data;
+        })
+        .catch((error) => {
+            return {
+                rules: [],
+                last_period: { end_time: 0, start_time: 0 },
+                next_period: {
+                    end_time: 0,
+                    start_time: 0,
+                },
+                amount: 0,
+                bet: 0,
+                status: "expired",
+            };
         });
 };
 const CashbackInfo = async () => {
     const vipInfo = await getVipInfoApi();
     const cashbackInfo = await getCashBackApi();
-    console.log(`🚀🚀🚀🚀🚀-> in page.tsx on 43`, cashbackInfo);
 
     const currentGrade = cashbackInfo.rules?.find(
         (item) => item.level === (vipInfo.vip_level || 1)