Переглянути джерело

fix: 修改类型错误导致的打包失败

Before 10 місяців тому
батько
коміт
020b7641c2

+ 1 - 1
.env.development

@@ -1,2 +1,2 @@
 # NEXT_PUBLIC_BASE_URL=http://192.168.0.66:8800
-NEXT_PUBLIC_BASE_URL=http://206.168.191.125:8800
+NEXT_PUBLIC_BASE_URL=http://192.168.0.84:8800

+ 1 - 1
src/api/home.ts

@@ -216,7 +216,7 @@ export interface NoticeRep {
     renter_id: number;
     id: number;
     send_time: number;
-    action_type: number;
+    action_type: ActionType;
     action_params: string;
     is_window: 1 | 2;
     desc: string;

+ 2 - 2
src/app/[locale]/(TabBar)/[[...share]]/@noticeWidget/page.tsx

@@ -1,9 +1,9 @@
-import { NoticeRep } from "@/api/home";
+import { BannerRep } from "@/api/home";
 import HomeNoticeBar from "@/app/[locale]/(TabBar)/[[...share]]/_home/HomeNoticeBar";
 import { server } from "@/utils/server";
 const getNotices = async () => {
     return server
-        .request<NoticeRep[]>({
+        .request<BannerRep[]>({
             url: "/v1/api/front/marquee",
             method: "POST",
             body: JSON.stringify({}),

+ 3 - 2
src/app/[locale]/(TabBar)/[[...share]]/_home/HomeNoticeBar.tsx

@@ -1,13 +1,14 @@
 "use client";
-import { NoticeRep } from "@/api/home";
+import { BannerRep } from "@/api/home";
 import Box from "@/components/Box";
 import { Swiper } from "antd-mobile";
 import { FC } from "react";
 interface Props {
-    notices: NoticeRep[];
+    notices: BannerRep[];
 }
 const HomeNoticeBar: FC<Props> = (props) => {
     const { notices } = props;
+    console.log(`🚀🚀🚀🚀🚀-> in HomeNoticeBar.tsx on 11`, notices);
     return (
         <div className={"my-[0.0694rem] flex items-center"}>
             <div className={"iconfont icon-laba mr-[0.06rem] text-[yellow]"}></div>

+ 1 - 1
src/app/[locale]/(enter)/components/FromCom/index-copy.tsx

@@ -47,7 +47,7 @@ const FromCom: FC<PropsWithChildren<FromComProps>> = ({ type = "login", msgError
 
     const formAction = async (formData: FormData) => {
         Toast.show({ icon: "loading", duration: 3000, maskClickable: false });
-        const result = await loginAction(formData, type);
+        const result = await loginAction(formData);
         // todo token存放位置在本地, 优化目标: 要做服务端渲染应该获取cookie里面的token
         setUserInfo(result.user);
         setToken(result.token!);

+ 3 - 7
src/app/[locale]/affiliate/payments/page.tsx

@@ -1,12 +1,8 @@
 "use client";
-import {
-    getWithdrawalListApi,
-    InfoDayListRequest,
-    UserLevelToDayPagination,
-    UserWithdrawalList,
-} from "@/api/summary";
+import { getWithdrawalListApi, InfoDayListRequest, UserWithdrawalList } from "@/api/summary";
 import Table from "@/components/Table";
 import { useGlobalStore } from "@/stores";
+import { Pagination } from "@/types";
 import dayjs from "dayjs";
 import { useTranslations } from "next-intl";
 import { FC, useRef, useState } from "react";
@@ -17,7 +13,7 @@ const App: FC<Props> = (props) => {
     const t = useTranslations("PaymentsPage");
     const [dataSource, setDataSource] = useState<{
         list: UserWithdrawalList[];
-        page: UserLevelToDayPagination;
+        page: Partial<Pagination>;
     }>({
         list: [],
         page: {},

+ 3 - 7
src/app/[locale]/affiliate/report/page.tsx

@@ -1,12 +1,8 @@
 "use client";
-import {
-    getInfoDayList,
-    InfoDayListRequest,
-    UserLevelToDayPagination,
-    UserTodayInfoList,
-} from "@/api/summary";
+import { getInfoDayList, InfoDayListRequest, UserTodayInfoList } from "@/api/summary";
 import Table from "@/components/Table";
 import { useGlobalStore } from "@/stores";
+import { Pagination } from "@/types";
 import dayjs from "dayjs";
 import { useTranslations } from "next-intl";
 import { FC, useRef, useState } from "react";
@@ -17,7 +13,7 @@ const App: FC<Props> = (props) => {
     const t = useTranslations("ReportPage");
     const [dataSource, setDataSource] = useState<{
         list: UserTodayInfoList[];
-        page: UserLevelToDayPagination;
+        page: Partial<Pagination>;
     }>({
         list: [],
         page: {},

+ 2 - 2
src/middleware.ts

@@ -2,7 +2,7 @@ import createMiddleware from "next-intl/middleware";
 import { NextFetchEvent, NextRequest, NextResponse } from "next/server";
 import { locales } from "./i18n";
 
-function stackMiddleware(functions: Function[], index = 0) {
+function stackMiddleware(functions: Function[], index = 0): Function {
     const current = functions[index];
     if (current) {
         const next = stackMiddleware(functions, index + 1);
@@ -22,7 +22,7 @@ function localMiddleware() {
 }
 
 const whiteRouters = ["/"];
-function authMiddleware(next) {
+function authMiddleware(next: Function) {
     return async (request: NextRequest, res: NextResponse) => {
         console.log(
             `🎯🎯🎯🎯🎯-> in middleware.ts on 28`,