Browse Source

feat: 增加test

Before 1 năm trước cách đây
mục cha
commit
348728cc99
3 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 10 0
      src/api/test.ts
  2. 5 0
      src/app/[locale]/_home/HomeGames.tsx
  3. 1 0
      src/utils/server/index.ts

+ 10 - 0
src/api/test.ts

@@ -0,0 +1,10 @@
+import { server } from "@/utils/server";
+
+export const getUserApi = () => {
+    return server.get({
+        url: "/v1/api/user/send_code",
+        params: {
+            user_phone: "13222222222",
+        },
+    });
+};

+ 5 - 0
src/app/[locale]/_home/HomeGames.tsx

@@ -1,5 +1,6 @@
 "use client";
 import { getGamesApi, GroupType } from "@/api/home";
+import { getUserApi } from "@/api/test";
 import { SwiperGroup } from "@/components/Card";
 import { FC, PropsWithChildren, useEffect, useState } from "react";
 import "swiper/css";
@@ -20,6 +21,10 @@ const HomeSwiper: FC<PropsWithChildren<Props>> = (props) => {
         getGamesApi().then((res) => {
             setGroupGames(res.data);
         });
+
+        getUserApi().then((res) => {
+            console.log(`🎯🎯🎯🎯🎯-> in HomeGames.tsx on 25`, res);
+        });
     }, []);
     return (
         <div>

+ 1 - 0
src/utils/server/index.ts

@@ -2,6 +2,7 @@ import Request from "./axios";
 const server = new Request({
     timeout: 10 * 1000,
     baseURL: "http://127.0.0.1:4523/m1/4790544-4444647-default",
+    // baseURL: "http://192.168.0.66:6060",
     transform: {
         // instance  interceptor
         requestInterceptor: (config) => {